Skip to content

Commit

Permalink
Merge branch 'main' into feat/system_proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie committed May 1, 2024
2 parents 3ffba89 + 070db64 commit 8be2bca
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/protocol/http/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,6 @@ func (f *Fetcher) fetchChunk(index int, ctx context.Context) (err error) {
chunk := f.chunks[index]
chunk.retryTimes = 0

httpReq, err := f.buildRequest(ctx, f.meta.Req)
if err != nil {
return err
}
var (
client = f.buildClient()
buf = make([]byte, 8192)
Expand Down Expand Up @@ -314,8 +310,13 @@ func (f *Fetcher) fetchChunk(index int, ctx context.Context) (err error) {
}

var (
resp *http.Response
httpReq *http.Request
resp *http.Response
)
httpReq, err = f.buildRequest(ctx, f.meta.Req)
if err != nil {
return
}
if f.meta.Res.Range {
httpReq.Header.Set(base.HttpHeaderRange,
fmt.Sprintf(base.HttpHeaderRangeFormat, chunk.Begin+chunk.Downloaded, chunk.End))
Expand Down

0 comments on commit 8be2bca

Please sign in to comment.