Skip to content
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

fix(cors): ACAO header was not sent when conf.origins has multiple #13334

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

ms2008
Copy link
Contributor

@ms2008 ms2008 commented Jul 4, 2024

Summary

The CORS plugin allows the use of the wildcard * to match all origins. However, when multiple entries are configured in conf.origins and one of them is *, the CORS plugin fails to send the ACAO response header. Additionally, the logs report an error entry like pcre2_compile() failed: quantifier does not follow a repeatable item in "*$" at "*$".

This fix addresses the issue, and ensures consistent behavior with when setting * as a single value in conf.origins.

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 FTI-6062

entries and has `*` included

The CORS plugin allows the use of the wildcard "*" to match all origins.
However, when multiple entries are configured in `conf.origins` and one
of them is "*", the CORS plugin fails to send the ACAO response header.
Additionally, the logs report an error entry like `pcre2_compile()
    failed: quantifier does not follow a repeatable item in "*$" at
    "*$"`.

This fix addresses the issue, and ensures consistent behavior with
when setting "*" as a single value in `conf.origins`.
@github-actions github-actions bot added plugins/cors cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Jul 4, 2024
@ms2008 ms2008 marked this pull request as ready for review July 4, 2024 07:51
@VicYP VicYP requested a review from catbro666 July 4, 2024 09:33
@ms2008 ms2008 merged commit 41af9cd into master Jul 24, 2024
25 checks passed
@ms2008 ms2008 deleted the fix/cors-wildcard branch July 24, 2024 02:01
@team-gateway-bot
Copy link
Collaborator

Successfully created cherry-pick PR for master:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee plugins/cors size/M
5 participants