From 04ed02f420789235c35df9281757a297b92ed263 Mon Sep 17 00:00:00 2001 From: buffermet <29265684+buffermet@users.noreply.github.com> Date: Wed, 9 Apr 2025 12:39:33 +0200 Subject: [PATCH] Reduce overhead. --- modules/http_proxy/http_proxy_js_request.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/http_proxy/http_proxy_js_request.go b/modules/http_proxy/http_proxy_js_request.go index c0ba9f26..563c9b33 100644 --- a/modules/http_proxy/http_proxy_js_request.go +++ b/modules/http_proxy/http_proxy_js_request.go @@ -117,6 +117,7 @@ func (j *JSRequest) CheckIfModifiedAndUpdateHash() bool { } func (j *JSRequest) GetHeader(name, deflt string) string { + name = strings.ToLower(name) headers := strings.Split(j.Headers, "\r\n") for i := 0; i < len(headers); i++ { if headers[i] != "" { @@ -124,7 +125,7 @@ func (j *JSRequest) GetHeader(name, deflt string) string { if len(header_parts) != 0 && len(header_parts[0]) == 3 { header_name := string(header_parts[0][1]) header_value := string(header_parts[0][2]) - if strings.ToLower(name) == strings.ToLower(header_name) { + if name == strings.ToLower(header_name) { return header_value } }