aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorGravatar Scott Kidder <scott@kidder.io> 2023-10-30 11:08:51 -0700
committerGravatar GitHub <noreply@github.com> 2023-10-30 19:08:51 +0100
commit42bd7bb7e27a1c529b908892f9ce73f52cfd2292 (patch)
treeb4592f5de13b8d2ae08faf8a55ec792f08dd99fc /client.go
parentBUGFIX: HostClient.DialDualStack not work when using DoDeadline (#1634) (diff)
downloadfasthttp-42bd7bb7e27a1c529b908892f9ce73f52cfd2292.tar.gz
fasthttp-42bd7bb7e27a1c529b908892f9ce73f52cfd2292.tar.bz2
fasthttp-42bd7bb7e27a1c529b908892f9ce73f52cfd2292.zip
Allow redirect URI path to not be normalized. (#1638)
* Allow redirect URI path to not be normalized. * Introduce DisableRedirectPathNormalizing field to Request * Use field name as start of comment. Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com> --------- Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
Diffstat (limited to 'client.go')
-rw-r--r--client.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/client.go b/client.go
index 1c1b486..02456d3 100644
--- a/client.go
+++ b/client.go
@@ -1064,16 +1064,17 @@ func doRequestFollowRedirects(req *Request, resp *Response, url string, maxRedir
err = ErrMissingLocation
break
}
- url = getRedirectURL(url, location)
+ url = getRedirectURL(url, location, req.DisableRedirectPathNormalizing)
}
return statusCode, body, err
}
-func getRedirectURL(baseURL string, location []byte) string {
+func getRedirectURL(baseURL string, location []byte, disablePathNormalizing bool) string {
u := AcquireURI()
u.Update(baseURL)
u.UpdateBytes(location)
+ u.DisablePathNormalizing = disablePathNormalizing
redirectURL := u.String()
ReleaseURI(u)
return redirectURL