From 71ce626e48398f313a429e29429de1ad67ade956 Mon Sep 17 00:00:00 2001 From: C-Sto <7466346+C-Sto@users.noreply.github.com> Date: Thu, 23 May 2019 15:43:02 +0800 Subject: [PATCH] fix content length breaking soft 404 stuff --- librecursebuster/net.go | 2 ++ main.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/librecursebuster/net.go b/librecursebuster/net.go index 801be05..e5b4c81 100644 --- a/librecursebuster/net.go +++ b/librecursebuster/net.go @@ -116,6 +116,8 @@ func (gState *State) HTTPReq(method, path string, client *http.Client) (resp *ht return resp, err } resp.Body = ioutil.NopCloser(bytes.NewBuffer(body)) + //when the transfer encoding was chunked - this caused the response length to be -1, breaking the soft 404 stuff. Honestly, the HTTP spec is a massive pain in the ass. + resp.ContentLength = int64(len(body)) return resp, err } diff --git a/main.go b/main.go index 60974e1..4ab24f3 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ import ( "github.com/fatih/color" ) -const version = "1.6.10" +const version = "1.6.11" func main() { if runtime.GOOS == "windows" { //lol goos