From 8bd2bdfd9cc958a93819a4ac781ebfab675434be Mon Sep 17 00:00:00 2001 From: "Thomas P." Date: Thu, 19 Dec 2024 19:49:24 +0100 Subject: [PATCH] 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 --- proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.go b/proxy.go index 2fd8a5a..c0902d6 100644 --- a/proxy.go +++ b/proxy.go @@ -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, } }