(req *http.Request)
| 424 | } |
| 425 | |
| 426 | func (t redirectFollowingTransport) RoundTrip(req *http.Request) (*http.Response, error) { |
| 427 | if len(*t.methods) == 0 { |
| 428 | return t.inner.RoundTrip(req) |
| 429 | } |
| 430 | *t.methods = append(*t.methods, req.Method) |
| 431 | return &http.Response{ |
| 432 | StatusCode: http.StatusNoContent, |
| 433 | Header: http.Header{}, |
| 434 | Body: io.NopCloser(bytes.NewBufferString("")), |
| 435 | Request: req, |
| 436 | }, nil |
| 437 | } |
| 438 | |
| 439 | func TestUnexpectedStatusError(t *testing.T) { |
| 440 | tests := []struct { |