fix(proxy): handle lowercase Location header (#20)

When the upstream server returns a redirect HTTP response code but its "Location" header is in lowercase, the proxy will retry the request 5 times and eventually fail with an "missing Location header for http redirect" error.

Since the HTTP spec says header names are case-insensitive, we should handle this case properly. Adjust fasthttp options accordingly

Ref: https://github.com/valyala/fasthttp/issues/1361
This commit is contained in:
Thomas P.
2024-12-19 19:49:24 +01:00
committed by GitHub
parent 55e7d99b6a
commit 8bd2bdfd9c
+1 -1
View File
@@ -30,7 +30,7 @@ func createFasthttpClient(timeout int) *fasthttp.Client {
WriteTimeout: time.Duration(timeout) * time.Second,
MaxIdleConnDuration: time.Duration(timeout) * time.Second,
MaxConnDuration: time.Duration(timeout) * time.Second,
DisableHeaderNamesNormalizing: true,
DisableHeaderNamesNormalizing: false,
}
}