mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
nginx: Remove invalid extra headers for OPTIONS /api/v1/events.
Since 204 responses don’t contain a payload body, Content-Type is
neither required nor encouraged (RFC 7231 §3.1.1.5), and ours was
missing a semicolon to boot; Content-Length is expressly
forbidden (RFC 7230 §3.3.2).
Furthermore, these add_header directives were silencing the CORS
headers set in api_headers, because add_header inheritance doesn’t
work the way you think it does, as was known before commit
5614d51afc.
Fixes: #12902.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
934d7c2f0f
commit
b758ed5ac1
@@ -30,8 +30,6 @@ location /api/v1/events {
|
||||
include /etc/nginx/zulip-include/api_headers;
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Content-Type' 'text/plain charset=UTF-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user