net/http: NewFileTransport does not populate Response.Request on redirect #51562
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The
http.NewFileTransport
creates a transport whereRoundTrip
does not populate theRequest
field of itshttp.Response
on redirects.Given the following Go program:
Using a local directory structure:
What did you expect to see?
I expected the program to print:
The
request url
print line indicates that thehttp.Response
returned by the client has itsRequest
field populated, which allows the caller to understand the final URL requested along the (local) redirect chain.What did you see instead?
Using Go 1.17.8, the program prints:
The
no response redirect
indicates that thehttp.Response
returned by the client has an emptyRequest
field, which is different than the behavior seen when using non-file transports.The text was updated successfully, but these errors were encountered: