![]() |
CORS Problem with option request - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: CORS Problem with option request (/thread-2493.html) |
CORS Problem with option request - Ronald Krause - 08-19-2021 Hallo, I have a content handler that delivers some geoJSON for an openlayers map. We use custom HTTP headers for authentication. All works well if called from inside my application. But if I call it from a second website, I get a "Missing CORS Header" Error. I have enabled CORS support according to this advice: https://www.atozed.com/2019/04/cors-support-now-available/ My understanding is: The call generates an OPTIONS request, and this OPTIONS-Request is not answered correctly. I tried to add Allow-Origin-headers manually, but none of the events I tried were triggered by the OPTIONS-Request. I tested ServerController.OnAfterDispach, .OnBeforeDispach, .OnNewSession as well as the ContentHandler.Execute. The ContentHandlers RequiresSessionStart property does not change anything. This is Browser protocol: Code: XHR OPTIONS http://localhost:50085/map?appkey=9e9s3wAqqX1A&unit=location&shape=point&date=17.10.2020&type=1 What am I missing? Best Regards, Ronald Krause RE: CORS Problem with option request - Jose Nilton Pace - 08-19-2021 Hi Ronald, I have been getting good results in situations like yours, using .OnAfterDispach Code: procedure TIWServerController.IWServerControllerBaseAfterDispatch( |