JS and page refers to non-existing "OPTION" method #4

Closed
algal opened this Issue Mar 21, 2013 · 4 comments

Projects

None yet

2 participants

@algal
algal commented Mar 21, 2013

Hi,

The CORS spec requires preflight requests that use the HTTP method OPTIONS.

This page, and the JS generated by it, attempts to use the HTTP method OPTION. But there is no such HTTP method and this is not a correct CORS preflight request.

@monsur
Owner
monsur commented Mar 21, 2013

Can you provide a link to test-cors.org that demonstrates this issue? You can make HTTP OPTIONS requests when doing CORS; a preflight is identified when the HTTP method is OPTIONS and the Access-Control-Request-Method header are present.

@algal
algal commented Mar 21, 2013

When I go to http://client.cors-api.appspot.com/client I see OPTION not OPTIONS, and when I look at the JS code it shows in the code pane I see a line that says "var method = 'OPTION';" not "var method = 'OPTIONS';"

It seems like the web app is missing the "S" everywhere, which will cause it to generate preflight requests that are not recognized as preflight requests.

For instance, try setting the header to "Access-Control-Request-Method:GET" and the URL to "https://cors-test.appspot.com/test". This will work with OPTIONS, but not with OPTION.

@algal
algal commented Mar 21, 2013

This is a very handy web app, by the way. Sorry to be a bit terse.

@monsur monsur closed this in 312413e Mar 27, 2013
@monsur
Owner
monsur commented Mar 27, 2013

Thanks for the report! This is fixed on the live site now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment