-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Adding support for navigation history to matchers #1432
Conversation
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.
Looks good.
if respPayloads != nil { | ||
rawResp.WriteString("HTTP/1.1 ") | ||
rawResp.WriteString(fmt.Sprint(respPayloads.ResponseCode)) | ||
rawResp.WriteString(" " + respPayloads.ResponsePhrase + "+\n") |
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.
I think in the "+\n"
, the +
sign is a mistake.
Also his might be more readable:
rawResp.WriteString(fmt.Sprintf("HTTP/1.1 %d %s\n", respPayloads.ResponseCode, respPayloads.ResponsePhrase))
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.
I think in the
"+\n"
, the+
sign is a mistake.
Nice catch - fixed in #1465
Also his might be more readable:
rawResp.WriteString(fmt.Sprintf("HTTP/1.1 %d %s\n", respPayloads.ResponseCode, respPayloads.ResponsePhrase))
^ @Ice3man543 - This was implemented as requested in #1432 (comment)
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.
I must disagree with that comment. In the original version (which actually coincides with my recommendation ;-) ), it's clearly visible that it describes one HTTP request line. Splitting it into multiple lines, not only makes the code longer (without any relevant performance benefit), but clutters the logic and makes it harder to follow.
Proposed changes
This PR adds support for navigation history (HTTP raw request/responses) to matchers
Checklist
How to reproduce
history
: