New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http has broken compatibility on redirection handler #3795
Labels
Milestone
Comments
Some discussion on the topic has happened on golang-dev: https://groups.google.com/d/topic/golang-dev/j7VmXb9nd5M/discussion Owner changed to ---. |
We can regrettably "fix" the Client redirect back to returning two non-nil values, but it'll have to be documented/tested. I'm less sure about RoundTrip. It's always been documented on the interface about what the expectations are for implementations of a RoundTripper. What's the issue there? I'll accept this bug for now, but patches welcome. I won't start working on it until Monday at least, and I'll change the status to "Started" here when I do start. Owner changed to @bradfitz. |
Now that I re-look at the docs (the same as shipped with Go 1), I care about RoundTrip even less. Note: http://golang.org/pkg/net/http/#RoundTripper // [...] 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. ... there's even a "must" in there. |
Gustavo, the original change does say: "Revision: f7839a55036e Author: Brad Fitzpatrick <bradfitz@golang.org> Date: Tue Jun 19 09:10:14 2012 Log: net/http: clarify client return values in docs Also, fixes one violation found during testing where both response and error could be non-nil when a CheckRedirect test failed. This is arguably a minor API (behavior, not signature) change, but it wasn't documented either way and was inconsistent & non-Go like. Any code depending on the old behavior was wrong anyway." |
This issue was closed by revision dfd7f18. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: