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:
commit
9cc1cb0361
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue