diff --git a/cmd/httpx/httpx.go b/cmd/httpx/httpx.go index fce62f3..d442b9e 100644 --- a/cmd/httpx/httpx.go +++ b/cmd/httpx/httpx.go @@ -207,9 +207,8 @@ retry: builder.WriteString(fmt.Sprintf(" [%d]", resp.ContentLength)) } - title := "" + title := httpx.ExtractTitle(resp) if scanopts.OutputTitle { - title = httpx.ExtractTitle(resp) builder.WriteString(fmt.Sprintf(" [%s]", title)) } diff --git a/common/httpx/httpx.go b/common/httpx/httpx.go index 4418e8c..c059bee 100644 --- a/common/httpx/httpx.go +++ b/common/httpx/httpx.go @@ -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 }