Hello all,
In go1*, one can return an error from a CheckRedirect implementation
and Do will return the last response, besides the error.
The following revision (surprisingly given its summary) changed that:
changeset: 13619:f7839a55036e
user: Brad Fitzpatrick <
brad...@golang.org>
date: Tue Jun 19 09:10:14 2012 -0700
summary: net/http: clarify client return values in docs
After this change, the response is nil.
I can workaround the change, but besides the API breakage it feels
sane to have the last response in those situations, since the idea of
not redirecting is to avoid another request rather than poisoning the
previous response.
Looking at the change set, it seems that a similar behavioral change
was done for RoundTrip as well. I'm not being affected by this one,
but it's probably worth taking it into account as a behavior change
too, at least to properly document it as such.
gustavo @
http://niemeyer.net