From dd08976e8bc2564efbf3268796fcad1da8e51882 Mon Sep 17 00:00:00 2001 From: buffermet <29265684+buffermet@users.noreply.github.com> Date: Sat, 3 Oct 2020 02:00:41 +1000 Subject: [PATCH] Update HTTP header regexp selector. --- modules/http_proxy/http_proxy_js_request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/http_proxy/http_proxy_js_request.go b/modules/http_proxy/http_proxy_js_request.go index 76ed8f09..b4dc1d93 100644 --- a/modules/http_proxy/http_proxy_js_request.go +++ b/modules/http_proxy/http_proxy_js_request.go @@ -29,7 +29,7 @@ type JSRequest struct { bodyRead bool } -var header_regexp = regexp.MustCompile(`(.*?): (.*)`) +var header_regexp = regexp.MustCompile(`^\s*(.*?)\s*:\s*(.*)\s*$`) func NewJSRequest(req *http.Request) *JSRequest { headers := ""