Conversation
mmatczuk
reviewed
May 21, 2024
internal/martian/flush.go
Outdated
|
|
||
| func shouldFlush(res *http.Response) bool { | ||
| if res.Request.Method == http.MethodHead { | ||
| if res.Request.Method == http.MethodHead || res.Request.Method == http.MethodConnect { |
Contributor
There was a problem hiding this comment.
I'm not sure this should be here.
Failed connect is free to return response as any other method.
Contributor
Author
There was a problem hiding this comment.
OK, I will drop that.
Contributor
|
Good catch please add a test. |
76223dc to
a099f7f
Compare
'Content-Length: 0' is not expected in the CONNECT response * Connected to localhost (::1) port 3128 * CONNECT tunnel: HTTP/1.1 negotiated * allocate connect buffer * Establish HTTP proxy tunnel to httpbin:8080 > CONNECT httpbin:8080 HTTP/1.1 > Host: httpbin:8080 > User-Agent: curl/8.4.0 > Proxy-Connection: Keep-Alive > < HTTP/1.1 200 OK < Content-Length: 0 * Ignoring Content-Length in CONNECT 200 response < * CONNECT phase completed * CONNECT tunnel established, response 200
Modify CONNECT response content length before it gets logged.
a099f7f to
deee6ea
Compare
Contributor
Author
|
Tests were added. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.