mirror of
https://github.com/projectdiscovery/httpx.git
synced 2024-12-01 12:13:00 +03:00
Fixing follow-host-redirects option when customizing the host request header
This commit is contained in:
parent
0a26550cd2
commit
9b53795521
@ -75,7 +75,10 @@ func New(options *Options) (*HTTPX, error) {
|
||||
redirectFunc = func(redirectedRequest *http.Request, previousRequests []*http.Request) error {
|
||||
// Check if we get a redirect to a different host
|
||||
var newHost = redirectedRequest.URL.Host
|
||||
var oldHost = previousRequests[0].URL.Host
|
||||
var oldHost = previousRequests[0].Host
|
||||
if oldHost == "" {
|
||||
oldHost = previousRequests[0].URL.Host
|
||||
}
|
||||
if newHost != oldHost {
|
||||
// Tell the http client to not follow redirect
|
||||
return http.ErrUseLastResponse
|
||||
|
Loading…
Reference in New Issue
Block a user