Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 98,105
» Latest member: banlicoto1970
» Forum threads: 2,426
» Forum posts: 11,371

Full Statistics

Online Users
There are currently 1434 online users.
» 1 Member(s) | 1428 Guest(s)
Applebot, Baidu, Bing, Google, Yandex, qq88zcom

Latest Threads
WebApplication.IP change ...
Forum: IntraWeb General Discussion
Last Post: MJS@mjs.us
09-11-2026, 09:49 PM
» Replies: 1
» Views: 189
Hook/callback to handle t...
Forum: IntraWeb General Discussion
Last Post: Lenfors
09-08-2026, 09:03 AM
» Replies: 0
» Views: 154
Reproducible IIS crash in...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
09-08-2026, 01:48 AM
» Replies: 0
» Views: 170
The packages IW16.xx inc...
Forum: IntraWeb General Discussion
Last Post: hsbelli
09-03-2026, 11:46 AM
» Replies: 2
» Views: 473
Redirection issues with F...
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 10:03 AM
» Replies: 0
» Views: 242
Source Code
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 08:11 AM
» Replies: 3
» Views: 642
TContenthandler requires ...
Forum: IntraWeb General Discussion
Last Post: valmeras
08-30-2026, 02:35 AM
» Replies: 0
» Views: 225
TIWjQDBGrid erratic behav...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
08-20-2026, 05:12 PM
» Replies: 8
» Views: 2,241
Change Language DataTable
Forum: IntraWeb General Discussion
Last Post: Rigoberto Mercedes
08-19-2026, 03:21 PM
» Replies: 1
» Views: 358
How to terminate HTTP Thr...
Forum: Indy
Last Post: rlebeau
08-14-2026, 08:01 AM
» Replies: 5
» Views: 985

 
  Memory leak with madExcept
Posted by: troberts - 09-06-2022, 07:39 PM - Forum: IntraWeb General Discussion - Replies (1)

Hi,

I am having problems with madExcept reporting a memory leak. I am using IW V15.2.65, Delphi 11.1, Firebird 4. I have also posted this in the madExcept forum.

The problem can be easily reproduced.

  • Start a new standalone IW application.

  • On the UserSession form place a TFDConnection (Con) and a TFDQuery (Qry).

  • In the IWUserSessionBaseCreate event configure the connection and execute a simple query.

  • Run the application and you should get a blank page in the browser.

  • Close the server and a leak report is generated.
Here's the code in IWUserSessionBaseCreate:


Code:

Code:
procedure TIWUserSession.IWUserSessionBaseCreate(Sender: TObject);
begin
  Con.DriverName := 'FB';
  Con.LoginPrompt := False;
  Con.Params.Values['User_Name'] := 'XXXX';
  Con.Params.Values['Password'] := 'XXXX';
  Con.Params.Values['CharacterSet'] := 'UTF8';
  Con.Params.Values['SQLDialect'] := '3';
  Con.Params.Database := 'localhost:C:\XXXX\DATA.FDB';

  Qry.Connection := Con;
  Qry.Open('select first 1 * from setup');
end;


The connection and the query are on the form and will be freed when the application closes.

The full leak report is shown below. Any ideas? I'd appreciate any assistance anyone can offer.

allocation number: 42459
program up time: 3.76 s
type: VirtualAlloc
address: $b690000
size: 4096
access rights: read/exec/write

thread $1f00 (TInThreadWithTask):
671aa0a8 madExcept32.dll madExceptDbg 2853 VirtualAllocCallback
007de410 VehicleAllocationWebsite.exe IWRtlFix 161 IW_MakeObjectInstance
006e0376 VehicleAllocationWebsite.exe Vcl.Controls 8725 TWinControl.Create
006a2aa6 VehicleAllocationWebsite.exe Vcl.Forms 3330 TScrollingWinControl.Create
0077691e VehicleAllocationWebsite.exe IWVCLBaseContainer 210 TIWBaseContainer.Create
007d13a5 VehicleAllocationWebsite.exe IWBaseForm 588 TIWBaseForm.CreateNew
007a6fc9 VehicleAllocationWebsite.exe IWForm 338 TIWForm.CreateNew
007d0b43 VehicleAllocationWebsite.exe IWBaseForm 363 TIWBaseForm.Create
007d0bea VehicleAllocationWebsite.exe IWBaseForm 380 TIWBaseForm.Create
007d67ee VehicleAllocationWebsite.exe IWApplication 535 TIWApplication.CreateAndShowDefaultPage
00815dfc VehicleAllocationWebsite.exe IWServerSession 582 TIWServerSession.StartForm
00816c35 VehicleAllocationWebsite.exe IWServerSession 889 TIWServerSession.ExecuteForm
008164ba VehicleAllocationWebsite.exe IWServerSession 784 TIWServerSession.DoExecuteSession
008164e1 VehicleAllocationWebsite.exe IWServerSession 789 TIWServerSession.DoExecuteSession
00816afb VehicleAllocationWebsite.exe IWServerSession 871 TIWServerSession.ExecuteSession
00816b59 VehicleAllocationWebsite.exe IWServerSession 880 TIWServerSession.ExecuteSession
00816b7d VehicleAllocationWebsite.exe IWServerSession 883 TIWServerSession.ExecuteSession
00804567 VehicleAllocationWebsite.exe IWServer 687 TIWServer.ExecuteUrl
00804585 VehicleAllocationWebsite.exe IWServer 689 TIWServer.ExecuteUrl
00804a7c VehicleAllocationWebsite.exe IWServer 761 TIWServer.Execute
00804acd VehicleAllocationWebsite.exe IWServer 763 TIWServer.Execute
00804b58 VehicleAllocationWebsite.exe IWServer 776 TIWServer.Execute
00813293 VehicleAllocationWebsite.exe IWServerSession 97 HttpExecute
008132ae VehicleAllocationWebsite.exe IWServerSession 98 HttpExecute
00895e34 VehicleAllocationWebsite.exe IW.Server.HTTPIndy 246 THTTPServerIndy.DoCommandGet
00895ea7 VehicleAllocationWebsite.exe IW.Server.HTTPIndy 257 THTTPServerIndy.DoCommandGet
00895ee1 VehicleAllocationWebsite.exe IW.Server.HTTPIndy 265 THTTPServerIndy.DoCommandGet
00878200 VehicleAllocationWebsite.exe InCustomHTTPServer 1427 TInCustomHTTPServer.DoExecute
0084fa37 VehicleAllocationWebsite.exe InContext 185 TInContext.Run
004beeaf VehicleAllocationWebsite.exe madExcept HookedTThreadExecute
0055400d VehicleAllocationWebsite.exe System.Classes 15711 ThreadProc
0040b6cc VehicleAllocationWebsite.exe System 25395 ThreadWrapper
004bed95 VehicleAllocationWebsite.exe madExcept CallThreadProcSafe
004bedfa VehicleAllocationWebsite.exe madExcept ThreadExceptFrame
76236737 KERNEL32.DLL BaseThreadInitThunk

memory dump:
0b690000 00 00 00 00 59 e9 72 e3 - 14 f5 e8 f5 ff ff ff 00 ....Y.r.........
0b690010 00 00 00 00 00 00 00 e8 - e8 ff ff ff 0a 00 69 0b ..............i.
0b690020 00 00 00 00 e8 db ff ff - ff 17 00 69 0b 00 00 00 ...........i....
0b690030 00 e8 ce ff ff ff 24 00 - 69 0b 00 00 00 00 e8 c1 ......$.i.......
0b690040 ff ff ff 31 00 69 0b 00 - 00 00 00 e8 b4 ff ff ff ...1.i..........
0b690050 3e 00 69 0b 00 00 00 00 - e8 a7 ff ff ff 4b 00 69 >.i..........K.i
0b690060 0b 00 00 00 00 e8 9a ff - ff ff 58 00 69 0b 00 00 ..........X.i...
0b690070 00 00 e8 8d ff ff ff 65 - 00 69 0b 00 00 00 00 e8 .......e.i......
0b690080 80 ff ff ff 72 00 69 0b - 00 00 00 00 e8 73 ff ff ....r.i......s..
0b690090 ff 7f 00 69 0b 00 00 00 - 00 e8 66 ff ff ff 8c 00 ...i......f.....
0b6900a0 69 0b 00 00 00 00 e8 59 - ff ff ff 99 00 69 0b 00 i......Y.....i..
0b6900b0 00 00 00 e8 4c ff ff ff - a6 00 69 0b 00 00 00 00 ....L.....i.....
0b6900c0 e8 3f ff ff ff b3 00 69 - 0b 00 00 00 00 e8 32 ff .?.....i......2.
0b6900d0 ff ff c0 00 69 0b 00 00 - 00 00 e8 25 ff ff ff cd ....i......%....
0b6900e0 00 69 0b 00 00 00 00 e8 - 18 ff ff ff da 00 69 0b .i............i.
0b6900f0 00 00 00 00 e8 0b ff ff - ff e7 00 69 0b 00 00 00 ...........i....
0b690100 00 e8 fe fe ff ff f4 00 - 69 0b 00 00 00 00 e8 f1 ........i.......
0b690110 fe ff ff 01 01 69 0b 00 - 00 00 00 e8 e4 fe ff ff .....i..........
0b690120 0e 01 69 0b 00 00 00 00 - e8 d7 fe ff ff 1b 01 69 ..i............i
0b690130 0b 00 00 00 00 e8 ca fe - ff ff 28 01 69 0b 00 00 ..........(.i...

allocation number: 28519
program up time: 3.31 s
type: Thread Handle
handle: $c7c
access rights: $1fffff
threadId: $1a68
processId: $4170
process exe: C:\Projects\WIS\Websites\DispatcherPortal\Win32\Debug\VehicleAllocationWebsite.exe

thread $4504 (TInThreadWithTask):
671ad1ee madExcept32.dll madExceptDbg 4058 CreateThreadCallback
004bf31b VehicleAllocationWebsite.exe madExcept HookedCreateThread
004bf360 VehicleAllocationWebsite.exe madExcept HookedCreateThread
7647641f ucrtbase.dll _beginthreadex
00ac75c4 VehicleAllocationWebsite.exe FireDAC.Phys.FB 529 TFDPhysFBConnection.InternalConnect
00a794bd VehicleAllocationWebsite.exe FireDAC.Phys 3347 TFDPhysConnection.DoConnect
00a79fcd VehicleAllocationWebsite.exe FireDAC.Phys 3521 TFDPhysConnection.Open
00a7a035 VehicleAllocationWebsite.exe FireDAC.Phys 3530 TFDPhysConnection.Open
00a7a086 VehicleAllocationWebsite.exe FireDAC.Phys 3537 TFDPhysConnection.Open
0097b735 VehicleAllocationWebsite.exe FireDAC.Comp.Client 4185 TFDCustomConnection.SetConnected
0097b7b1 VehicleAllocationWebsite.exe FireDAC.Comp.Client 4194 TFDCustomConnection.SetConnected
008be2d0 VehicleAllocationWebsite.exe Data.DB 3520 TCustomConnection.Open
0097a0d9 VehicleAllocationWebsite.exe FireDAC.Comp.Client 3685 TFDCustomConnection.CheckActive
0097a134 VehicleAllocationWebsite.exe FireDAC.Comp.Client 3688 TFDCustomConnection.CheckActive
0097c0ac VehicleAllocationWebsite.exe FireDAC.Comp.Client 4410 TFDCustomConnection.Trace
00980fb7 VehicleAllocationWebsite.exe FireDAC.Comp.Client 6501 TFDCustomCommand.SetPrepared
00981147 VehicleAllocationWebsite.exe FireDAC.Comp.Client 6533 TFDCustomCommand.SetPrepared
0098138e VehicleAllocationWebsite.exe FireDAC.Comp.Client 6584 TFDCustomCommand.SetPrepared
00474191 VehicleAllocationWebsite.exe System.Variants 905 @VarClr
0098156d VehicleAllocationWebsite.exe FireDAC.Comp.Client 6597 TFDCustomCommand.Prepare
00816a40 VehicleAllocationWebsite.exe IWServerSession 851 TIWServerSession.ExecuteSession
00407698 VehicleAllocationWebsite.exe System 4935 @GetMem
00ec0ca9 VehicleAllocationWebsite.exe ServerController 49 TIWServerController.IWServerControllerBaseNewSession
0076cc5f VehicleAllocationWebsite.exe IWServerControllerBase 1060 TIWServerControllerBase.DoNewSession
00816a40 VehicleAllocationWebsite.exe IWServerSession 851 TIWServerSession.ExecuteSession
00813293 VehicleAllocationWebsite.exe IWServerSession 97 HttpExecute
00895e34 VehicleAllocationWebsite.exe IW.Server.HTTPIndy 246 THTTPServerIndy.DoCommandGet
00878200 VehicleAllocationWebsite.exe InCustomHTTPServer 1427 TInCustomHTTPServer.DoExecute
0084fa37 VehicleAllocationWebsite.exe InContext 185 TInContext.Run
004beeaf VehicleAllocationWebsite.exe madExcept HookedTThreadExecute
0055400d VehicleAllocationWebsite.exe System.Classes 15711 ThreadProc
004076b4 VehicleAllocationWebsite.exe System 4983 @FreeMem
00409834 VehicleAllocationWebsite.exe System 17926 TObject.FreeInstance
004beb69 VehicleAllocationWebsite.exe madExcept InterceptClassDestroy
0040991d VehicleAllocationWebsite.exe System 17981 TObject.Destroy
00ab0227 VehicleAllocationWebsite.exe FireDAC.Phys.IBWrapper 3406 TIBDatabase.Attach
00ab0273 VehicleAllocationWebsite.exe FireDAC.Phys.IBWrapper 3416 TIBDatabase.Attach
00ab0297 VehicleAllocationWebsite.exe FireDAC.Phys.IBWrapper 3418 TIBDatabase.Attach
00abb55a VehicleAllocationWebsite.exe FireDAC.Phys.IBDef 327 TFDPhysIBConnectionDefParams.GetOpenMode
00abf5f4 VehicleAllocationWebsite.exe FireDAC.Phys.IBBase 1748 TFDPhysIBConnectionBase.InternalConnect
00abf65d VehicleAllocationWebsite.exe FireDAC.Phys.IBBase 1756 TFDPhysIBConnectionBase.InternalConnect
00abf919 VehicleAllocationWebsite.exe FireDAC.Phys.IBBase 1783 TFDPhysIBConnectionBase.InternalConnect
00ac75c4 VehicleAllocationWebsite.exe FireDAC.Phys.FB 529 TFDPhysFBConnection.InternalConnect
00ac75ff VehicleAllocationWebsite.exe FireDAC.Phys.FB 531 TFDPhysFBConnection.InternalConnect
00a79400 VehicleAllocationWebsite.exe FireDAC.Phys 3321 TFDPhysConnection.ConnectBase
00a794bd VehicleAllocationWebsite.exe FireDAC.Phys 3347 TFDPhysConnection.DoConnect
00a79fcd VehicleAllocationWebsite.exe FireDAC.Phys 3521 TFDPhysConnection.Open
00a7a035 VehicleAllocationWebsite.exe FireDAC.Phys 3530 TFDPhysConnection.Open
00a7a086 VehicleAllocationWebsite.exe FireDAC.Phys 3537 TFDPhysConnection.Open
0097ac16 VehicleAllocationWebsite.exe FireDAC.Comp.Client 3999 TFDCustomConnection.DoInternalLogin
0097b8f8 VehicleAllocationWebsite.exe FireDAC.Comp.Client 4219 TFDCustomConnection.DoConnect
0097b9ec VehicleAllocationWebsite.exe FireDAC.Comp.Client 4232 TFDCustomConnection.DoConnect
0097ba3a VehicleAllocationWebsite.exe FireDAC.Comp.Client 4238 TFDCustomConnection.DoConnect
008be315 VehicleAllocationWebsite.exe Data.DB 3538 TCustomConnection.SetConnected
0097b735 VehicleAllocationWebsite.exe FireDAC.Comp.Client 4185 TFDCustomConnection.SetConnected
0097b7b1 VehicleAllocationWebsite.exe FireDAC.Comp.Client 4194 TFDCustomConnection.SetConnected
008be2d0 VehicleAllocationWebsite.exe Data.DB 3520 TCustomConnection.Open
0097a0d9 VehicleAllocationWebsite.exe FireDAC.Comp.Client 3685 TFDCustomConnection.CheckActive
0097a134 VehicleAllocationWebsite.exe FireDAC.Comp.Client 3688 TFDCustomConnection.CheckActive
0097c0ac VehicleAllocationWebsite.exe FireDAC.Comp.Client 4410 TFDCustomConnection.Trace
00980fb7 VehicleAllocationWebsite.exe FireDAC.Comp.Client 6501 TFDCustomCommand.SetPrepared
00981147 VehicleAllocationWebsite.exe FireDAC.Comp.Client 6533 TFDCustomCommand.SetPrepared
0098138e VehicleAllocationWebsite.exe FireDAC.Comp.Client 6584 TFDCustomCommand.SetPrepared
00474191 VehicleAllocationWebsite.exe System.Variants 905 @VarClr
00948b80 VehicleAllocationWebsite.exe FireDAC.Comp.DataSet 1827 TFDDataSet.DoMasterDefined

Print this item

  Open URL in a newTabl window
Posted by: staff@ergosoft.it - 09-05-2022, 02:32 PM - Forum: IntraWeb General Discussion - Replies (4)

Hi,

very simple question... I need to open a page in external url in new tab on browser...

how can I do?

this NOT work:

      Webapplication.GoToURL(sUrl, False);

      WebApplication.Redirect(sUrl, False);

thanks

Alessandro Romano

Print this item

  IOS Safari camera access
Posted by: rburton - 08-31-2022, 12:49 PM - Forum: IntraWeb General Discussion - Replies (3)

Does anyone know a way to access the camera from the Safari browser in iOS?  I have tried the camera demo from the demos bundle in github which works fine on a pc using the chrome browser but just hangs when using in Safari.

I want to be able to create a web application to allow the user to input some details of a product and then be able to take a photograph.

Thank you

Print this item

  sync event iwbutton
Posted by: Anto90 - 08-31-2022, 09:22 AM - Forum: IntraWeb General Discussion - Replies (1)

Hi at all,
from today sync event of iwbutton stop working. I use iw 15.2.48.
Seem browsers had some updates so click does not fire.

Any news on this?
Someone has the same problem?

Andrea

Print this item

  Word Press Integration
Posted by: joelcc - 08-29-2022, 02:42 PM - Forum: IntraWeb General Discussion - No Replies

Are there any suggestions on how to do Word Press Integration with IW?

Print this item

  Server page
Posted by: jessFr - 08-24-2022, 12:53 PM - Forum: IntraWeb General Discussion - Replies (3)

Hi guys  Smile

I am a beginner with Intraweb. I use Delphi 11.
I would like to know how to directly launch the web display page without having to interact with this server page 

Thank you



Attached Files Thumbnail(s)
   
Print this item

  TIdTelnet
Posted by: omarreis - 08-23-2022, 11:32 AM - Forum: Indy - Replies (3)

Hi

I'm using TIdTelnet client in my Firemonkey project to receive streaming text.

Works fine for iOS and Android, but on Windows I cannot detect when the client was disconnected by the server.  If I try to send data on the closed socket I get 10054 error.

I tried OnDisconnect and OnStatus events, but it seems that those are not called when the socket is closed by the server.

How can I detect that the client was disconnected by the server on Windows ?

Thanks
Omar

Print this item

  New IW 15 features
Posted by: Alexandre Machado - 08-23-2022, 07:12 AM - Forum: IntraWeb General Discussion - Replies (4)

One of our customers asked me for a list containing all new things introduced since we moved from version 14 to 15.

To be honest, we didn't have this list. It is simply too long. But I decided to compile such a list. I'm excluding somethings that I consider "minor".

If you are using IW 14, you definitely need to read this!

Warning: Reading this list can take a good part of your day.

I'm keeping each point short. Some parts contain personal comments (in parenthesis):


  1. New Http.sys application type. (Http.sys is huge. Creating it from scratch using 100% of our own code was big and rewarding).
  2. IW Bootstrap is now included with IntraWeb
  3. New zlib library. IW zlib is based on zlib Cloudflare code base and is more than 8x faster than Delphi XE7 zlib. (playing with pure-C code like this was the funniest thing I've done in programming in a long time and it was extremely rewarding)
  4. New TIWTemplateParserHTML. Template parsing and processing is more than 300% faster than IW 14 version. (the old template had some die-hard bugs. The new code is so simple and performs so well...)
  5. Removed /$/ (Exec command) from URL in browser (yes, we didn't like it, so it's gone)
  6. LockSessionTimeout property in ServerController. (some people don't know how important this is)
  7. New feature CheckWindowId which allows applications to detect when a link to a valid IW application session is used in another browser tab (If you don't know what this does, then it's my fault)
  8. TIWGrid and descendants now render <thead> and <tbody> (every TIWGrid is basically a style-less DataTable)
  9. ISAPI applications now allow redirection from HTTP to HTTPS (have you tried to do it yourself in IIS?)
  10. ServerController Options Wizard (you can save and restore ServerController properties both at runtime and design time)
  11. Content Security Policy (CSP) support. (this was major. Hundreds of parts of our code needed to be rewritten - and rethought - to be CSP compliant)
  12. Cross-Origin Resource Sharing (CORS) support
  13. Callback function infrastructure was completely refactored. (Nice to have anonymous functions as callbacks)
  14. New advanced lock-free data structures used for session control. (Have never written so many unit tests in my whole life. I believe is the most challenging part of programming that I've dealt with)
  15. New start-up/loading code is used when starting a new session. (yes, this was great. IW 15 needs 2 round-trips less than IW 14)
  16. New property ServerController.BlockedDocExtensions (security, security, security!)
  17. Full AJAX (Async) render capability. (No need to tell you how this is important, right)
  18. New security feature, IP access table (security, security, security!)
  19. New TIWVideo control
  20. New components IWjQGrid and IWjQDBGrid
  21. New tool “IntraWeb Certificate Manager” (yes, even the competitors download IntraWeb and use this tool)
  22. New TabOrder editor/logic
  23. New IWRecaptcha component
  24. New IWSelect component based on JQuery Select2
  25. New IWjQAccordion and IWjQPageControl
  26. New unit/class IW.HTTP.IndyClient/TIWHTTPClient which simplifies communication tasks like sending HTTP requests to other services/applications (GET and POST, both in HTTP and HTTPS).
  27. New class TIWTelegram. (man, this is simple and effective. 100% based on (26) above.
  28. New component IWIPGeolocationClient (more security, security, security!)
  29. New property “DelayKeyEvents” for TIWEdit, TIWDBEdit, TIWMemo, TIWDBMemo. (Similar created with IWImage mouse events).
  30. Content Handlers: allow registration of a “catch-all” content handler
  31. New Session's TIWClipboard property (very handy. Not well known yet by IW programmers)
  32. New class properties LocalJavaScriptFolder and LocalStyleFolder in TIWjQPageControl, TIWjQAccordion, TIWjQGrid , allow customization of file location
  33. New property Image in TIWLink and TIWURL, allows links to be rendered with associated imageNew control TIWLabelEx, an extended version of IWLabel with image
  34. New property ThemeColor
  35. DelayMouseMoveEvents added to TIWImage, TIWImageFile
  36. New feature allows IW applications to automatically block sessions created from within other pages (IW application running inside IFrame)
  37. New version of IWBackIntercept.js which handles the back button blocking feature
  38. New component: TIWChartJS: the IntraWeb implementation of the famous ChartJS component library
  39. New component: TIWCanvas: HTML 5 canvas implementation that allows you to draw anything on the browser page (works very similarly to the VCL Canvas object, with similar methods)
  40. New component: TIWSignaturePad control: allows users to draw smooth signatures on the page surface using a pointing device
  41. IWjQAccordion, IWjQGrid, IWjQDBGrid, IWjQPageControl, IWChartJS and IWSignaturePad will download required content files (all required JS and CSS files) directly into the wwwroot folder

Enjoy!  Big Grin

Print this item

  IntraWeb Bootstrap and TFrame
Posted by: jindrich.volek - 08-20-2022, 09:59 AM - Forum: IntraWeb General Discussion - Replies (1)

Hi
I am at the start of developing intraweb bootstrap application. It should have about 8 pages with the same menu in the header. Do you think that it's good idea to use one frame with menu for each page, so the menu its going to be same for each page (it loads to TFrame)?
Thanks, Jindrich

Menu = IWBSNavBar+IWBSNavBarHeader+IWBSNavBar+IWBSNavBarCollapse

Print this item

  adding Access-Control-Allow-Origin header
Posted by: Boba TC - 08-20-2022, 04:37 AM - Forum: Indy - Replies (2)

Dear All;
with TIdHTTPServer, how do I add the "Access-Control-Allow-Origin" header?
My intuitive move with VCL was:

Code:
TIdHTTPServer *IdHTTPServer;
//...
void __fastcall
TForm1::IdHTTPServerHeadersAvailable(TIdContext *AContext, const UnicodeString AUri,
          TIdHeaderList *AHeaders, bool &VContinueProcessing)
{
  AHeaders->Add("Access-Control-Allow-Origin: *");
  VContinueProcessing = true;
}
but when I test it with simple HTML in web browser:
Code:
<!DOCTYPE HTML>
<HTML>
  <BODY>
    <BUTTON onclick="myFunction()" type="button">TEST</BUTTON>
    <SCRIPT>
      function myFunction(){
        let o = new XMLHttpRequest();
        //the IdHTTPServer is bound to "http://127.12.34.56:7890"
        o.open("GET", "http://127.12.34.56:7890/qwe", false);
        o.send();//No 'Access-Control-Allow-Origin' header is present ...
      };
    </SCRIPT>
  </BODY>
</HTML>
browser throws "No 'Access-Control-Allow-Origin' header is present...". The TIdHTTPServer server does get this request with no complains of any kind.
BTW, if I insert my URL "http://127.12.34.56:7890/qwe" into the browser's address bar and press Enter - everyone is happy even if the server does not add an extra header.
TIA/Boba

Print this item