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

feat(router): make header matching rules case insensitive #1584

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

df-wg
Copy link
Contributor

@df-wg df-wg commented Feb 11, 2025

Motivation and Context

Many users have found themselves in confusing places when they've tried to apply our header propagation rules, because they neglected to use the case insensitive prefix to the regex.

HTTP Header names are by RFC case insensitive, so there should be no need to explicitly declare them as case insensitive.

Any case where we were using the <header>.Get(HEADER) was by its nature case insensitive, but this specifically needed to fix the header matching rules

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.

Copy link

github-actions bot commented Feb 11, 2025

Router image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-7b532fc7d8a5729cb8de377bd15385787e4b94c9

@alepane21 alepane21 self-requested a review February 11, 2025 15:43
Copy link
Contributor

@alepane21 alepane21 left a comment

Choose a reason for hiding this comment

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

I was initially concerned that prepending the prefix to the regexp might break some existing patterns. However, I couldn’t identify any issues during testing. In the worst case, a previously non-functional rule might start working unexpectedly, but this risk seems minimal and non-blocking.

@df-wg df-wg merged commit c0bceaa into main Feb 13, 2025
13 checks passed
@df-wg df-wg deleted the dave/eng-6004-make-header-rules-case-insensitive branch February 13, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants