Commit 407d668b authored by recall704's avatar recall704 Committed by ginuerzh

return if error does not nil (#205)

parent d11b16c7
...@@ -59,13 +59,13 @@ func (h *sniHandler) Handle(conn net.Conn) { ...@@ -59,13 +59,13 @@ func (h *sniHandler) Handle(conn net.Conn) {
if hdr[0] != dissector.Handshake { if hdr[0] != dissector.Handshake {
// We assume it is an HTTP request // We assume it is an HTTP request
req, err := http.ReadRequest(bufio.NewReader(conn)) req, err := http.ReadRequest(bufio.NewReader(conn))
if !req.URL.IsAbs() {
req.URL.Scheme = "http" // make sure that the URL is absolute
}
if err != nil { if err != nil {
log.Logf("[sni] %s - %s : %s", conn.RemoteAddr(), conn.LocalAddr(), err) log.Logf("[sni] %s - %s : %s", conn.RemoteAddr(), conn.LocalAddr(), err)
return return
} }
if !req.URL.IsAbs() {
req.URL.Scheme = "http" // make sure that the URL is absolute
}
HTTPHandler(h.options...).(*httpHandler).handleRequest(conn, req) HTTPHandler(h.options...).(*httpHandler).handleRequest(conn, req)
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment