-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORS "Preflight" support #39
Comments
Any suggestion about how to implement this?, would you enable CORS using a flag?, if so, would you log the CORS request as well?, I'd love to hear from you so that we can build the right solution. |
One possibility would be to have two sets of headers that you can switch between, one for preflight, and one for normal. I don't think you need to do anything special except recognise a CORS preflight, and reply with the preflight headers. Your normal method of logging requests would handle the preflight just fine (and you can then use PageUp to see the preflight request). Here is an example of a preflight request: OPTIONS / HTTP/1.1 Here an example of the headers I use: Access-Control-Allow-Origin: * |
Closed by #40 |
I was trying to POST data from a form, but it was sending a CORS preflight request first.
I could handle this case by adding
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT
Access-Control-Allow-Headers: content-type
to the returned headers, and then at least the POST data was submitted. But then I had no control over the response to the POST.
The text was updated successfully, but these errors were encountered: