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: Missing header detection for the non-strict case #702

Merged
merged 1 commit into from Jan 30, 2024

Conversation

woodyza
Copy link
Contributor

@woodyza woodyza commented Jan 26, 2024

Hi!

When #651 was implemented the header matching rule was subtly broken, making it no longer detect when the specified headers were missing entirely (vs present, but with the wrong value) unless you used strict matching.

As far as I understand that is not the intention, and you should be able to use the header matcher to detect missing headers without necessarily caring about all of the other headers in the request. It's a small change to enable that, and it preserves the strict match and regex match logic.

I've added a test case that fails without the current change, and the rest of the cases still pass with it in place.

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (89d7f37) 99.93% compared to head (dd7b873) 99.93%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #702   +/-   ##
=======================================
  Coverage   99.93%   99.93%           
=======================================
  Files           9        9           
  Lines        3054     3064   +10     
=======================================
+ Hits         3052     3062   +10     
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@markstory markstory added the bug label Jan 30, 2024
@markstory markstory merged commit 1f36f22 into getsentry:master Jan 30, 2024
16 checks passed
@markstory
Copy link
Member

Thank you 🎉

markstory added a commit that referenced this pull request Jan 30, 2024
@woodyza woodyza deleted the detect-missing-headers branch January 31, 2024 03:10
@woodyza
Copy link
Contributor Author

woodyza commented Feb 13, 2024

Thanks @markstory for the merge 🙏 Any idea when 0.25.0 might come out?

@markstory
Copy link
Member

@woodyza I started a release build just now.

@woodyza
Copy link
Contributor Author

woodyza commented Feb 14, 2024

Awesome, thanks!

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.

None yet

2 participants