breautek commented on issue #944: URL: https://github.com/apache/cordova-ios/issues/944#issuecomment-658782840
I'm not really sure what is causing it not to work but one thing I noticed is that it doesn't appear that you accept/respond to the `OPTIONS` preflight request. When it comes to CORS, some requests will trigger a [preflight request](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Preflighted_requests). In my nginx config I basically do: ``` if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' $http_origin always; add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, OPTIONS, HEAD' always; add_header 'Access-Control-Allow-Headers' 'Accept, Content-Type, Access-Control-Allow-Origin' always; add_header 'Content-Type' 'text/plain charset=UTF-8' always; add_header 'Content-Length' 0 always; return 204; } ``` I'm sure you can adapt that to IIS equivilant. `$http_origin` is a variable for the incoming request's `Origin` header value. Not sure if this will solve the issue with your event stream request, but I think it's worth a try. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
