[
https://issues.apache.org/jira/browse/COUCHDB-3319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16169048#comment-16169048
]
Joan Touzet commented on COUCHDB-3319:
--------------------------------------
There is special handling for OPTIONS - CouchDB should be handling CORS
preflight requests correctly.
The code is here:
https://github.com/apache/couchdb/blob/f4c6113808d1809469df9c8be9d2f83ef399f064/src/chttpd/src/chttpd_cors.erl
The list of supported headers is here:
https://github.com/apache/couchdb/blob/f4c6113808d1809469df9c8be9d2f83ef399f064/src/chttpd/include/chttpd_cors.hrl
I see some headers in your request that are not in the list of supported
headers. Can you retry your request with curl, and only the headers as
specified in the SUPPORTED_HEADERS list and see if it succeeds? We may have to
expand the list to include e.g. headers set automatically by the user agent.
> Unable to modify cors/methods to enable HTTP OPTIONS requests
> -------------------------------------------------------------
>
> Key: COUCHDB-3319
> URL: https://issues.apache.org/jira/browse/COUCHDB-3319
> Project: CouchDB
> Issue Type: Bug
> Components: HTTP Interface
> Reporter: Peter Wilmott
>
> I'm running CouchDB 2.0.0 and in '/opt/couchdb/etc/local.d/local.ini' I have
> the following:
> {quote}
> ; CouchDB Configuration Settings
> ; Custom settings should be made in this file. They will override settings
> ; in default.ini, but unlike changes made to default.ini, this file won't be
> ; overwritten on server upgrade.
> [chttpd]
> bind_address = any
> [couchdb]
> uuid = e5675a08388ac8563d4b8e8d46e96d42
> [httpd]
> enable_cors = true
> [cors]
> origins = *
> methods = GET, POST, PUT, DELETE, OPTIONS
> {quote}
> The documentation indicates that 'cors/methods' is used to control which HTTP
> methods will be accepted:
> http://docs.couchdb.org/en/2.0.0/config/http.html?highlight=enable_cors#cors/methods
> However when I make an OPTIONS request I receive '405 Method Not Allowed' as
> a response. Additionally the response contains the following in it's headers:
> {quote}
> Allow:DELETE,GET,HEAD,POST,PUT,COPY
> {quote}
> Which seems to indicate that my configuration is not being used.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)