fix: handle empty string params (#620)

This commit is contained in:
Levi authored and GitHub committed 2024-07-24 11:51:31 +08:00
1 parent fab8f135f3
commit 473c58796c
7 files changed
+26 -9

No files matched your search

+1 -1
View File
@@ -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}
}