From 1f28619ef01889996be170990f4ea6b4635f4997 Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 6 Dec 2023 12:39:32 +0200 Subject: [PATCH] Fix parsing of Host header in HTTP tunnel --- internal/http_tunnel/http_tunnel.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/http_tunnel/http_tunnel.go b/internal/http_tunnel/http_tunnel.go index 1b39830..1572a49 100644 --- a/internal/http_tunnel/http_tunnel.go +++ b/internal/http_tunnel/http_tunnel.go @@ -152,7 +152,6 @@ func parseHTTP(bufferStr string) (map[string]string, string, string, string, str lines := strings.Split(headerPart, "\r\n") requestLine := lines[0] headerLines := lines[1:] - // Parse the request line requestLineParts := strings.Split(requestLine, " ") method := requestLineParts[0] @@ -178,7 +177,7 @@ func parseHTTP(bufferStr string) (map[string]string, string, string, string, str headers[headerName] = headerValue // Special handling for the Host header - if headerName == "Host" { + if strings.ToLower(headerName) == "host" { host = headerValue } }