We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This program worked in Go 1.6 and earlier but crashes with Go 1.7.
goroutine 1 [running]: panic(0x1d1440, 0xc82000c160) /Users/rsc/go/src/runtime/panic.go:500 +0x18c net/http.(*Client).doFollowingRedirects.func1(0x2e8680, 0xc82000d0e0, 0xc82002e030, 0x1) /Users/rsc/go/src/net/http/client.go:446 +0x93 net/http.(*Client).doFollowingRedirects(0x2fdc00, 0xc8200d20f0, 0x226478, 0xf, 0x0, 0x0) /Users/rsc/go/src/net/http/client.go:489 +0x8ad net/http.(*Client).Get(0x2fdc00, 0x20de9c, 0xf, 0x23b9, 0x1d5140, 0xc8200001a0) /Users/rsc/go/src/net/http/client.go:415 +0x89 main.main() /tmp/x.go:27 +0x38
package main import ( "fmt" "io/ioutil" "net/http" "strings" ) var client = &http.Client{ CheckRedirect: func(*http.Request, []*http.Request) error { return fmt.Errorf("no redirects!") }, Transport: new(tripper), } type tripper struct{} func (tripper) RoundTrip(*http.Request) (*http.Response, error) { resp := &http.Response{ StatusCode: 303, Header: map[string][]string{"Location": {"http://www.example.com/"}}, Body: ioutil.NopCloser(strings.NewReader("")), } return resp, nil } func main() { client.Get("http://foo.com/") }
The text was updated successfully, but these errors were encountered:
31283dd
No branches or pull requests
This program worked in Go 1.6 and earlier but crashes with Go 1.7.
The text was updated successfully, but these errors were encountered: