mirror of
https://github.com/projectdiscovery/httpx.git
synced 2024-11-28 22:01:28 +03:00
Fixed govet issues
This commit is contained in:
parent
4129b88c92
commit
bdc394abea
@ -51,10 +51,10 @@ func ParseRequest(req string) (method string, path string, headers map[string]st
|
||||
method = parts[0]
|
||||
|
||||
for {
|
||||
line, err := reader.ReadString('\n')
|
||||
line, readErr := reader.ReadString('\n')
|
||||
line = strings.TrimSpace(line)
|
||||
|
||||
if err != nil || line == "" {
|
||||
if readErr != nil || line == "" {
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -77,9 +77,9 @@ func New(options *Options) (*HTTPX, error) {
|
||||
}
|
||||
|
||||
if httpx.Options.HttpProxy != "" {
|
||||
proxyURL, err := url.Parse(httpx.Options.HttpProxy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
proxyURL, parseErr := url.Parse(httpx.Options.HttpProxy)
|
||||
if parseErr != nil {
|
||||
return nil, parseErr
|
||||
}
|
||||
transport.Proxy = http.ProxyURL(proxyURL)
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ func StringToSliceInt(s string) ([]int, error) {
|
||||
return r, nil
|
||||
}
|
||||
for _, v := range strings.Split(s, ",") {
|
||||
v := strings.TrimSpace(v)
|
||||
if i, err := strconv.Atoi(v); err == nil {
|
||||
vTrim := strings.TrimSpace(v)
|
||||
if i, err := strconv.Atoi(vTrim); err == nil {
|
||||
r = append(r, i)
|
||||
} else {
|
||||
return r, err
|
||||
|
Loading…
Reference in New Issue
Block a user