You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tested under go version 1.3 and 1.4RC
Cf. https://play.golang.org/p/tYAkpOSAOs
When you call http.ReadRequest on a raw request string that was dumped using DumpRequest
(or DumpRequestOut) the resulting request.URL is not filled, thus making it impossible
to issue via a Transport. (It will fail complaining about an 'unsupported protocol
scheme ""' because the URL doesn't start with any protocol indeed (cf
playground example)
Unrelated error but other people are also seeing a need for correct behavior of
ReadRequest
(https://golang.org/issue/7215&;q=httputil&colspec=ID%20Status%20Stars%20Release%20Owner%20Repo%20Summary)
The text was updated successfully, but these errors were encountered:
These aren't expected to round-trip. Information is naturally lost here because the wire
format doesn't include information about e.g. which scheme was used. ReadRequest never
populates the URL scheme.
These dump functions are mostly for debugging.
If you're writing a proxy, there is httputil.ReverseProxy to help.
Thanks for the quick reply.
Actually it does populates the URL scheme, but only for very specific cases (I just had
a look at http://golang.org/src/pkg/net/http/readrequest_test.go).
it's a shame we don't have a way to parse requests and issue them again, I am indeed
writing a proxy but needs to be able to reissue prior requests slightly modified (doing
security tests around various request parameters, could be host, url params, path, etc.).
I'll have a look at the httputil.ReverseProxy if it can help me do this.
by timothe@google.com:
The text was updated successfully, but these errors were encountered: