(ctx context.Context, client HTTPDoer, requestURL string, headers http.Header)
| 185 | } |
| 186 | |
| 187 | func pluginStoreGetNoRedirect(ctx context.Context, client HTTPDoer, requestURL string, headers http.Header) (*http.Response, error) { |
| 188 | if client == nil { |
| 189 | client = http.DefaultClient |
| 190 | } |
| 191 | req, errRequest := http.NewRequestWithContext(ctx, http.MethodGet, requestURL, nil) |
| 192 | if errRequest != nil { |
| 193 | return nil, fmt.Errorf("create request: %w", errRequest) |
| 194 | } |
| 195 | req.Header = headers.Clone() |
| 196 | resp, errDo := pluginStoreNoRedirectClient(client).Do(req) |
| 197 | if errDo != nil { |
| 198 | return nil, fmt.Errorf("request failed: %w", errDo) |
| 199 | } |
| 200 | return resp, nil |
| 201 | } |
| 202 | |
| 203 | func pluginStoreNoRedirectClient(client HTTPDoer) HTTPDoer { |
| 204 | httpClient, ok := client.(*http.Client) |
no test coverage detected