MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / RoundTrip

Method RoundTrip

internal/nodes/http_client_transport.go:15–26  ·  view source on GitHub ↗
(req *http.Request)

Source from the content-addressed store, hash-verified

13}
14
15func (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}

Callers

nothing calls this directly

Calls 3

httpStatusIsRedirectFunction · 0.85
GetMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected