MCPcopy Create free account
hub / github.com/cli/cli / WithoutFollowingRedirects

Function WithoutFollowingRedirects

api/client.go:83–87  ·  view source on GitHub ↗

WithoutFollowingRedirects stops the request from following redirects. When a redirect is encountered, the request fails with an HTTPError carrying the redirect status code and headers rather than following the redirect. This matters for requests where following a redirect silently changes the meanin

()

Source from the content-addressed store, hash-verified

81// This option applies only to the REST request surface (Request and RequestWithContext). It has no
82// effect on GraphQL methods, which do not encounter redirects in practice.
83func WithoutFollowingRedirects() RequestOption {
84 return func(cfg *requestConfig) {
85 cfg.noFollowRedirects = true
86 }
87}
88
89// WithEndpointScopes adds OAuth scopes to a 4xx error as if the server endpoint had returned them.
90// This improves error messaging for endpoints that do not explicitly list the scopes they need, and

Callers 2

deleteRepoFunction · 0.92

Calls

no outgoing calls

Tested by 1