The current normalizePath function in uri.go removes all double slashes, for example:
req.SetRequestURI("https://example.com/api//test")
var resp *fasthttp.Response = fasthttp.AcquireResponse()
httpClient.Do(req, resp)
...
The code above will send a request to https://example.com/api/test and not https://example.com/api//test
The normalizePath is called through several other functions, but it is called regardless when sending a request, which makes it unavoidable. Currently the only practical use for normalizePath is removing the INITIAL double slash, if https://example.com/api//test is the set URI, the URI will turn into https://example.com//api//test thereafter normalizePath is called and removes all double slashes, though it should only be removing the first.
In rare cases you will have to access URLs utilizing double slashes, and you cannot do that with this library at the moment.
So I think it would be best if this was either removed, or modified in a certain way so you can keep certain double slashes.
The current
normalizePath
function inuri.go
removes all double slashes, for example:The code above will send a request to
https://example.com/api/test
and nothttps://example.com/api//test
The normalizePath is called through several other functions, but it is called regardless when sending a request, which makes it unavoidable. Currently the only practical use for normalizePath is removing the INITIAL double slash, if
https://example.com/api//test
is the set URI, the URI will turn intohttps://example.com//api//test
thereafternormalizePath
is called and removes all double slashes, though it should only be removing the first.In rare cases you will have to access URLs utilizing double slashes, and you cannot do that with this library at the moment. So I think it would be best if this was either removed, or modified in a certain way so you can keep certain double slashes.