Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
1.3
-
None
Description
Browsers can send a if-none-match header to couchdb, but this can will break when CORS is enabled. The reason seems to be the header comes in as a binary, eg from the debug log the header is:
{'If-None-Match',"\"V9J3604P4V9VTR5H77SBHJW\""},
When maybe_apply_cors_headers is called, the assumption is that the headers are strings. This can be seen here: https://github.com/apache/couchdb/blob/b0420f9006915149e81607615720f32f21c76725/src/couchdb/couch_httpd_cors.erl#L219
Thus a string:to_lower is undefined as can be seen in this stacktrace:
[info] [<0.148.0>] Stacktrace: [{string,to_lower,
[undefined],
[
,
{line,468}]},
{couch_httpd_cors,maybe_apply_cors_headers,2,
[
,
]},
{couch_httpd,send_response,4,
[{file,
See original gist https://gist.github.com/ryanramage/5143964#file-gistfile1-txt-L64
Attachments
Issue Links
- is duplicated by
-
COUCHDB-1706 function_clause error when querying views with cors
- Closed