Open GoogleCodeExporter opened 8 years ago
I ran into the same problem, although with an empty-bodied request, so I didn't
run into the consumption problem.
I've got another point to add to this: I've observed that the server I'm
interacting with (google storage for developers) returns 403 rather than 401 on
a bad token.
As nice as the transparent retry / refresh logic is, I think it's a bad idea to
keep it at all. The behavior is explicitly called out as invalid in the go
http package doc:
// RoundTrip executes a single HTTP transaction, returning
// the Response for the request req. RoundTrip should not
// attempt to interpret the response. In particular,
// RoundTrip must return err == nil if it obtained a response,
// regardless of the response's HTTP status code. A non-nil
// err should be reserved for failure to obtain a response.
The idea of duplicating the body for every request terrifies me. This will
carry substantial cost for applications which routinenely PUT large files (like
mine).
Original comment by ip...@google.com
on 28 Jul 2011 at 7:53
Original issue reported on code.google.com by
tarmi...@gmail.com
on 19 Jun 2011 at 11:25Attachments: