-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 requests fail with a 405 method not allow for OPTIONS #865
Comments
I think to properly run cross domain with non POST/GET methods, we do need to respond to the OPTIONS preflight request. POST and GET don't send a preflight, and to my knowledge there's no way to skip preflight with headers. So, we'll need to respond to OPTIONS, basically. |
It could be great if the CORS headers could be inferred and settled automatically to avoid issues in browsers. Following the W3C spec this could be done easily based on the existent HTTP request headers. Probably adding a new Consul config field to enable it would be fine, or alternatively as sort of plugin/addon. The config field could be:
|
I'm running into this too. Is there any reason we wouldn't want "enableFullCORS: true" to be default ? |
IMO Consul should implement CORS support by default inferring it based on the request HTTP, unless it's explicitly defined that you don't want enable it. |
This is becoming quite a problem when developing against Consul Agent running locally. The browser app I'm working on cannot make PUTs due to blocked OPTIONS. |
same here, it should be able to handle |
UPDATE: I opened a PR #1807, note this is only for kv. |
I am also attempting to develop browser application to interact with the Consul HTTP API, and am blocked by this issue. It also effects
|
Hi, |
No solution yet? I can't use PUT to update k/v on a web UI I'm building. |
Any update? |
Now that we support https://www.consul.io/docs/agent/options.html#http_api_response_headers, can we just add generic support for OPTIONS requests and make things work? |
Any update on this? It's blocking me on developing an app against the API. |
Running into this same issue. |
I'm running my fork and successfully using CORS |
Hi,
I tried to setup CORS headers:
I verified that those headers are return during a XHR request. However, when I tried to do PUT, browser send an OPTIONS request first (http://stackoverflow.com/questions/8153832/xmlhttprequest-changes-post-to-option) and consul return a 405 method not allow.
My request looks like this:
and response
So I think the issue comes from consul itself when denied OPTIONS method?
The text was updated successfully, but these errors were encountered: