(req *http.Request)
| 13 | } |
| 14 | |
| 15 | func (this *HTTPClientTransport) RoundTrip(req *http.Request) (*http.Response, error) { |
| 16 | resp, err := this.Transport.RoundTrip(req) |
| 17 | if err != nil { |
| 18 | return resp, err |
| 19 | } |
| 20 | |
| 21 | // 检查在跳转相关状态中Location是否存在 |
| 22 | if httpStatusIsRedirect(resp.StatusCode) && len(resp.Header.Get("Location")) == 0 { |
| 23 | resp.Header.Set("Location", emptyHTTPLocation) |
| 24 | } |
| 25 | return resp, nil |
| 26 | } |
nothing calls this directly
no test coverage detected