From 47e2d957d15ed3de36ec1a71f15ae06c92a8cf9a Mon Sep 17 00:00:00 2001 From: v2ray Date: Mon, 11 Jan 2016 12:35:28 +0100 Subject: [PATCH] don't process malformed request --- proxy/http/http.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy/http/http.go b/proxy/http/http.go index aee5ac4b..e57cb448 100644 --- a/proxy/http/http.go +++ b/proxy/http/http.go @@ -106,6 +106,7 @@ func (this *HttpProxyServer) handleConnection(conn *net.TCPConn) { request, err := http.ReadRequest(reader) if err != nil { + log.Warning("Failed to read http request: %v", err) return } log.Info("Request to Method [%s] Host [%s] with URL [%s]", request.Method, request.Host, request.URL.String()) @@ -120,6 +121,7 @@ func (this *HttpProxyServer) handleConnection(conn *net.TCPConn) { dest, err := parseHost(host, defaultPort) if err != nil { log.Warning("Malformed proxy host (%s): %v", host, err) + return } if strings.ToUpper(request.Method) == "CONNECT" { this.handleConnect(request, dest, reader, conn)