mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-13 11:53:41 +00:00
fix: handle empty string params (#620)
This commit is contained in:
7 files changed
+26
-9
No files matched your search
@@ -405,7 +405,7 @@ func (f *Fetcher) buildRequest(ctx context.Context, req *base.Request) (httpReq
|
||||
body = bytes.NewBufferString(extra.Body)
|
||||
}
|
||||
}
|
||||
if _, ok := headers[base.HttpHeaderUserAgent]; !ok {
|
||||
if v := headers[base.HttpHeaderUserAgent]; len(v) == 0 || v[0] == "" {
|
||||
// load user agent from config
|
||||
headers[base.HttpHeaderUserAgent] = []string{f.config.UserAgent}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user