Fix http handshake

This commit is contained in:
世界 2022-07-01 13:29:56 +08:00
parent eb347e80a4
commit 719a27fc42
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -75,13 +75,7 @@ func HandleConnection(ctx context.Context, conn net.Conn, reader *std_bufio.Read
return handler.NewConnection(ctx, requestConn, metadata)
}
keepAlive := strings.TrimSpace(strings.ToLower(request.Header.Get("Proxy-Connection"))) == "keep-alive"
host := request.Header.Get("Host")
if host != "" {
request.Host = host
}
keepAlive := !(request.ProtoMajor == 1 && request.ProtoMinor == 0) && strings.TrimSpace(strings.ToLower(request.Header.Get("Proxy-Connection"))) == "keep-alive"
request.RequestURI = ""
removeHopByHopHeaders(request.Header)