Skip to content

cors: do not modify response headers for requests not matching origin#33133

Merged
wbpcode merged 1 commit intoenvoyproxy:mainfrom
cpakulski:issue/33086
Mar 29, 2024
Merged

cors: do not modify response headers for requests not matching origin#33133
wbpcode merged 1 commit intoenvoyproxy:mainfrom
cpakulski:issue/33086

Conversation

@cpakulski
Copy link
Copy Markdown
Contributor

Commit Message:
cors: Do not modify response headers for requests not matching origin
Additional Description:
Regular cors requests (not preflights), which did not match configured allowed origins are forwarded upstream to the server. It seems that treatment of responses to such requests was undefined. There was no documentation, no unit nor integration tests which enforced whether extra headers should be added to responses to such request. Before #33051, the headers were not added and after the #33051 headers were added. This PR brings the behaviour to original and headers are not added. Docs have been updated and unit test was added to enforce this behaviour.
Risk Level: Low
Testing: Added unit test.
Docs Changes: Updated.
Release Notes: No
Platform Specific Features: No
Fixes #33086

…ured origin.

Signed-off-by: Christoph Pakulski <paker8848@gmail.com>
Copy link
Copy Markdown
Member

@wbpcode wbpcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@wbpcode wbpcode merged commit b27e0b0 into envoyproxy:main Mar 29, 2024
@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Mar 29, 2024

Thanks a lot. 🌹

@cpakulski
Copy link
Copy Markdown
Contributor Author

Thanks for reviewing @wbpcode! (IMHO reviewing is harder than coding).

alyssawilk pushed a commit to alyssawilk/envoy that referenced this pull request Apr 29, 2024
…envoyproxy#33133)

cors: Do not modify response headers for requests not matching configured origin.

Signed-off-by: Christoph Pakulski <paker8848@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CORS filter sets the access-control-expose-headers header even when the origin is not allowed

2 participants