mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-12 03:14:09 +00:00
feat: support custom http request headers (#868)
This commit is contained in:
9 files changed
+160
-67
No files matched your search
@@ -427,6 +427,10 @@ func (f *Fetcher) buildRequest(ctx context.Context, req *base.Request) (httpReq
|
||||
return
|
||||
}
|
||||
httpReq.Header = headers
|
||||
// Override Host header
|
||||
if host := headers.Get(base.HttpHeaderHost); host != "" {
|
||||
httpReq.Host = host
|
||||
}
|
||||
return httpReq, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user