diff options
author | Scott Kidder <scott@kidder.io> | 2023-10-30 11:08:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-30 19:08:51 +0100 |
commit | 42bd7bb7e27a1c529b908892f9ce73f52cfd2292 (patch) | |
tree | b4592f5de13b8d2ae08faf8a55ec792f08dd99fc /client.go | |
parent | BUGFIX: HostClient.DialDualStack not work when using DoDeadline (#1634) (diff) | |
download | fasthttp-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.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |