-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
Feature request: Allow regex-matching for header values #651
Comments
please provide an example of the expected syntax and use case |
I added an example, please see if it helps clarify what I meant. |
@spreeni have you considered creating a custom matcher? |
@beliaev-maksim Hey sorry, I missed the notification somehow. Yes, I found custom matchers and that is how I implemented it myself now. But maybe as a convenience feature it would be nice to have this functionality directly within the matchers. It could make a fairly common approach more readable. |
@spreeni can you fire a PR with implementation proposal based on your custom matcher? |
@beliaev-maksim can I take this? |
@geetptl your contribution will be warmly welcomed! Please check Contribution section https://github.com/getsentry/responses#contributing |
Think I'll need to add one more test like |
I would like to match the expected format of a request-signature, without necessarily knowing the exact signature hash. To enable this or similar use cases, it would be nice to be able to supply compiled regex for the
matchers.header_matcher
similar as it is possible for the url.In general, this could be a nice feature for all other matchers as well.
Example:
If I want to for example test that an outgoing request to an external API is supplied with a valid signature and a Bearer token. Currently, I'd implement a custom matcher for this. But it would be nice to test header fields optionally with regex directly in the
header_matcher
.Ps: I love
responses
, thanks for the great work :)The text was updated successfully, but these errors were encountered: