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(plugins/request-transformer): remove lower-cased name when setting header value #12289

Closed
wants to merge 6 commits into from

Conversation

chronolaw
Copy link
Contributor

@chronolaw chronolaw commented Jan 4, 2024

Summary

As OpenResty's doc says (https://github.com/openresty/lua-nginx-module?tab=readme-ov-file#ngxreqget_headers), the result of ngx.req.get_headers() always has lower-case header name,
So if we set a X-Name header, it will not overwrite the existing header x-name.

This PR also fixed some flaky test cases(spec/03-plugins/36-request-transformer).

KAG-3462

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 #[issue number]

@chronolaw chronolaw marked this pull request as ready for review January 4, 2024 02:36
@chronolaw chronolaw added the cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee label Jan 4, 2024
@chronolaw chronolaw changed the title fix(plugins/request-transformer): always lower when set header value fix(plugins/request-transformer): always lower when setting header value Jan 4, 2024
Copy link
Contributor

@ADD-SP ADD-SP left a comment

Choose a reason for hiding this comment

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

@StarlightIbuki We need to re-implement #12244.

@chronolaw chronolaw added the pr/discussion This PR is being debated. Probably just a few details. label Jan 4, 2024
@chronolaw chronolaw changed the title fix(plugins/request-transformer): always lower when setting header value fix(plugins/request-transformer): remove lower-cased name when setting header value Jan 4, 2024
@chronolaw chronolaw marked this pull request as draft January 4, 2024 07:32
@chronolaw
Copy link
Contributor Author

We will revert #12244 then fix this flakiness.

@chronolaw chronolaw closed this Jan 5, 2024
@chronolaw chronolaw deleted the fix/request-transformer-always-lower-header branch January 5, 2024 02:23
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/request-transformer pr/discussion This PR is being debated. Probably just a few details. size/XS skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants