mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Strip CORS headers from applications (#8057)
The problem is that the headers get doubled up (not overwritten) and browsers do not like multiple values for the allowed origin even though it appears the spec allows for it. We could prefer the application's headers instead of ours but since we control OPTIONS I think preferring ours will by the more consistent experience and also aligns with the original RFC.
This commit is contained in:
@@ -124,12 +124,12 @@ will echo whatever the request sends.
|
||||
|
||||
These cross-origin headers are not configurable by administrative settings.
|
||||
|
||||
Applications can set their own headers which will override the defaults but this
|
||||
will only apply to non-preflight requests. Preflight requests through the
|
||||
dashboard are never sent to applications and thus cannot be modified by
|
||||
them. Read more about the difference between simple requests and requests that
|
||||
trigger preflights
|
||||
[here](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests).
|
||||
If applications set any of the above headers they will be stripped from the
|
||||
response except for `Vary` headers that are set to a value other than the ones
|
||||
listed above.
|
||||
|
||||
In other words, CORS behavior through the dashboard is not currently
|
||||
configurable by either admins or users.
|
||||
|
||||
#### Allowed by default
|
||||
|
||||
|
||||
Reference in New Issue
Block a user