1
1
Fork 0
mirror of https://github.com/OJ/gobuster.git synced 2024-06-02 06:36:03 +02:00

Land #86 - fix connecion reuse

This commit is contained in:
OJ 2018-07-05 16:17:09 +10:00
commit 9cc1cb0361
No known key found for this signature in database
GPG Key ID: D5DC61FB93260597

View File

@ -2,6 +2,7 @@ package libgobuster
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
@ -93,6 +94,13 @@ func MakeRequest(s *State, fullUrl, cookie string) (*int, *int64) {
} else {
*length = resp.ContentLength
}
} else {
// DO NOT REMOVE!
// absolutely needed so golang will reuse connections!
_, err = io.Copy(ioutil.Discard, resp.Body)
if err != nil {
return nil, nil
}
}
return &resp.StatusCode, length