mirror of
https://github.com/projectdiscovery/httpx.git
synced 2024-08-17 05:20:29 +03:00
adding error check on request
This commit is contained in:
parent
83a5340d32
commit
bcd2063cdc
@ -146,10 +146,12 @@ func (h *HTTPX) AddFilter(f Filter) {
|
||||
// NewRequest from url
|
||||
func (h *HTTPX) NewRequest(method, URL string) (req *retryablehttp.Request, err error) {
|
||||
req, err = retryablehttp.NewRequest(method, URL, nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// set default user agent
|
||||
req.Header.Set("User-Agent", h.Options.DefaultUserAgent)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user