mirror of https://github.com/v2ray/v2ray-core
don't process malformed request
parent
8daea1dc06
commit
47e2d957d1
|
@ -106,6 +106,7 @@ func (this *HttpProxyServer) handleConnection(conn *net.TCPConn) {
|
||||||
|
|
||||||
request, err := http.ReadRequest(reader)
|
request, err := http.ReadRequest(reader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Warning("Failed to read http request: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Info("Request to Method [%s] Host [%s] with URL [%s]", request.Method, request.Host, request.URL.String())
|
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)
|
dest, err := parseHost(host, defaultPort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warning("Malformed proxy host (%s): %v", host, err)
|
log.Warning("Malformed proxy host (%s): %v", host, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if strings.ToUpper(request.Method) == "CONNECT" {
|
if strings.ToUpper(request.Method) == "CONNECT" {
|
||||||
this.handleConnect(request, dest, reader, conn)
|
this.handleConnect(request, dest, reader, conn)
|
||||||
|
|
Loading…
Reference in New Issue