Closed antter closed 1 year ago
I'm afraid that this is not possible with fasthttp. fasthttp stores some headers into internal variables and will always write them in the same order as seen here: https://github.com/valyala/fasthttp/blob/f0865d4aabbbea51a81d56ab31a3de2dfc5a9b05/header.go#L2473-L2492 There is currently no way to change that. If you want to make a pull request to add support for this it would be welcome, but only if it doesn't affect performance.
Hi, I have a bit of an odd complaint. I originally turned to this package because you can control the case and ordering of headers, which is not possible with
net/http
.As I had come to find out, even when
SetCanonical
is used, theUser-Agent
header always comes beforeHost
. Headers re-ordering is a problem for proxies avoiding bot detection. In my case I am working on a proxy for intercepting traffic for web debugging. I end up sending out requests that starts withEven though Firefox would never put the
User-Agent
beforeHost
.