Skip to content

Commit

Permalink
fix: omit extraneous Authorization HTTP header sylabs#153
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmEff committed Dec 13, 2022
1 parent 54fbe14 commit 648b612
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,15 @@ type Downloader struct {

// httpGetRangeRequest performs HTTP GET range request to URL specified by 'u' in range start-end.
func (c *Client) httpGetRangeRequest(ctx context.Context, url string, start, end int64) (*http.Response, error) {
req, err := c.newRequestWithURL(ctx, http.MethodGet, url, nil)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
if err != nil {
return nil, err
}

if v := c.UserAgent; v != "" {
req.Header.Set("User-Agent", v)
}

req.Header.Add("Range", fmt.Sprintf("bytes=%d-%d", start, end))

return c.HTTPClient.Do(req)
Expand Down

0 comments on commit 648b612

Please sign in to comment.