Chore: code style

This commit is contained in:
yaling888
2022-06-06 02:37:10 +08:00
parent bf9eb000d2
commit 763929997b
11 changed files with 44 additions and 307 deletions

View File

@@ -308,7 +308,7 @@ func proxiesParseAndFilter(filter string, filterReg *regexp.Regexp, forceCertVer
if err := yaml.Unmarshal(buf, schema); err != nil {
proxies, err1 := convert.ConvertsV2Ray(buf)
if err1 != nil {
return nil, fmt.Errorf("%s, %w", err.Error(), err1)
return nil, fmt.Errorf("%w, %s", err, err1.Error())
}
schema.Proxies = proxies
}

View File

@@ -72,9 +72,7 @@ func (h *HTTPVehicle) Read() ([]byte, error) {
req.SetBasicAuth(user.Username(), password)
}
if req.UserAgent() == "" {
convert.SetUserAgent(req)
}
convert.SetUserAgent(req.Header)
req = req.WithContext(ctx)