docs-matrix-spec/content
Michael[tm] Smith d7cf63d981 Drop Origin & Accept from Access-Control-Allow-Headers value
This change drops the Origin and Accept header names from the
recommended value for the CORS Access-Control-Allow-Headers header. Per
the CORS protocol, it’s not necessary or useful to include them.

Per-spec at https://fetch.spec.whatwg.org/#forbidden-header-name, Origin
is a “forbidden header name” set by the browser and that frontend
JavaScript code is never allowed to set.

So the value of Access-Control-Allow-Headers isn’t relevant to Origin or
in general to other headers set by the browser itself — the browser
never ever consults the Access-Control-Allow-Headers value to confirm
that it’s OK for the request to include an Origin header.

And per-spec at https://fetch.spec.whatwg.org/#cors-safelisted-request-header,
Accept is a “CORS-safelisted request-header”, which means that browsers
allow requests to contain the Accept header regardless of whether the
Access-Control-Allow-Headers value contains "Accept".

So it’s unnecessary for the Access-Control-Allow-Headers to explicitly
include Accept. Browsers will not perform a CORS preflight for requests
containing an Accept request header.

Related: Related: https://github.com/matrix-org/synapse/pull/10114

Signed-off-by: Michael[tm] Smith <mike@w3.org>
2021-08-27 19:17:15 +01:00
..
client-server-api Drop Origin & Accept from Access-Control-Allow-Headers value 2021-08-27 19:17:15 +01:00
rooms Add knocking to the spec 2021-08-27 19:17:12 +01:00
_index.md Add knocking to the spec 2021-08-27 19:17:12 +01:00
appendices.md iterate 2021-08-27 19:17:14 +01:00
application-service-api.md Update content to call the new template for HTTP APIs 2021-08-27 19:16:42 +01:00
changelog.md Add changelog page and templates 2021-02-02 20:47:18 -08:00
identity-service-api.md Merge pull request #3170 from matrix-org/travis/spec/msc2713-rm-v1-id 2021-08-27 19:17:13 +01:00
proposals.md Clarify that implementations can use stable prefixes once an MSC has merged (#3179) 2021-08-27 19:17:14 +01:00
push-gateway-api.md Update content to call the new template for HTTP APIs 2021-08-27 19:16:42 +01:00
server-server-api.md Fix broken ASCII art 2021-08-27 19:17:14 +01:00