Skip to content

fix(plugin/cors): treat empty Origin header same as missing header #14368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 21, 2025

Conversation

dingjiayi
Copy link
Contributor

@dingjiayi dingjiayi commented Mar 18, 2025

Summary

This change ensures that an empty Origin header (Origin: "") is treated
the same way as a missing Origin header, fixing inconsistent behavior
between these two cases.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

Fix #14352

@dingjiayi dingjiayi closed this Mar 18, 2025
@dingjiayi dingjiayi reopened this Mar 18, 2025
@dingjiayi dingjiayi marked this pull request as draft March 18, 2025 08:34
@dingjiayi dingjiayi marked this pull request as ready for review March 18, 2025 12:16
@team-eng-enablement team-eng-enablement added the author/community PRs from the open-source community (not Kong Inc) label Mar 18, 2025
Copy link
Contributor

@StarlightIbuki StarlightIbuki left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Not a blocker but please take a look

@dingjiayi
Copy link
Contributor Author

Hi @StarlightIbuki 👋, a friendly ping to let me know if there's anything I can clarify or adjust to move this forward.

@StarlightIbuki
Copy link
Contributor

@dingjiayi Hi. Please address the new comments. Our policy requires 2 approvals from maintainers to merge a PR.

@chronolaw chronolaw changed the title fix(cors): treat empty Origin header same as missing header fix(plugin/cors): treat empty Origin header same as missing header Apr 16, 2025
@StarlightIbuki StarlightIbuki added the cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee label Apr 18, 2025
@StarlightIbuki
Copy link
Contributor

Thanks for your contribution! After all CI goes green this PR will be merged

@windmgc windmgc requested a review from ms2008 April 18, 2025 07:58
@chobits
Copy link
Contributor

chobits commented Apr 21, 2025

hi @ms2008 and @windmgc could you take a look at again? I'm reviewing community PR and issues and find this one has fixed one issue.#14352. I approved this PR, i think this fix is simple and easy to understand.

Copy link
Contributor

@ms2008 ms2008 left a comment

Choose a reason for hiding this comment

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

LGTM

@ms2008 ms2008 merged commit 826214b into Kong:master Apr 21, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author/community PRs from the open-source community (not Kong Inc) cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin(cors):Assertion failure on empty origin header
6 participants