From bcd2063cdc4d843c0936aa90185cac20a0c6148d Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Fri, 29 May 2020 21:59:18 +0200 Subject: [PATCH 1/2] adding error check on request --- common/httpx/httpx.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 } From df11fde4aacd1168de914139e52f5f5ef4d630be Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Fri, 29 May 2020 22:20:15 +0200 Subject: [PATCH 2/2] fixed empty title in json --- cmd/httpx/httpx.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)) }