-
Notifications
You must be signed in to change notification settings - Fork 6
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
Ignore Headers / Send Proxy Port / Dump Matcher Fails #604
Conversation
will ignore additional comma separated headers in replay and mimic mode while comparing.
will dump the two header or query object, if they are different.
will send the proxays port to the proxied host to improve redirects.
Note: OT: locally (on a mac) the test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all makes sense to me. Thanks for the contribution!
A couple of suggestions and then I think we're good.
README.md
Outdated
`-r, --redact-headers <headers>`: This option enables the redaction of specific HTTP header values, which are replaced by `XXXX` to maintain privacy or confidentiality during the recording of network interactions. The headers should be provided as a comma-separated list. | ||
|
||
|
||
`--dump-matcher-fails`: When exact request matching is enabled, this flag provides some debug information on why a request did not match any recorded tape. It is useful for troubleshooting and refining the conditions under which requests are considered equivalent, focusing on differences in headers and query parameters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Perhaps instead of the word dump
, we could use the word debug
instead throughout this PR? Its intent is a bit more obvious IMO.
.option( | ||
"-r, --redact-headers <headers>", | ||
"Request headers to redact", | ||
"Request headers to redact (values will be replaced by XXXX)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
Yup, I get the same, and I have the same conclusion that you had — it's another valid but different encoding. |
Co-authored-by: Tim Dawborn <tim.dawborn@gmail.com>
@timdawborn : sorry, I had to revert the suggestion, because otherwise there will be a type problem (I think, because of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@tft7000 Thanks! Do you have permission to merge this or do we need to merge it for you? (I can't easily check) |
@timdawborn : thanks for the review! |
I'll aim to create a release tomorrow my time. |
@tft7000 This contribution is now in the |
@timdawborn : Thanks for the quick review and merging / releasing. I appreciate your promptness. |
I added three flags that are needed in my situation and might be helpful for others:
--ignore-headers
: Allows users to specify a list of headers that should be ignored by Proxay. This is especially useful together with the--exact-request-matching
flag.--send-proxy-port
: Sends the proxays port to the proxied host, similar to nginx'proxy_set_header Host $host:$server_port;
. This helps against redirect issues.--dump-matcher-fails
: Dumps the headers from the current and recorded request, if they are not matching. This helps to find headers that should be ignored in the specific situation.For all three parts there are simple tests. I also added a paragraph in the Readme that documents those flags.