Skip to content

Commit

Permalink
Fix parsing of Host header in HTTP tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas committed Dec 6, 2023
1 parent 97b9c77 commit 1f28619
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/http_tunnel/http_tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
}
}
Expand Down

0 comments on commit 1f28619

Please sign in to comment.