From 407d668b83302948dcf1b71b6e912fcf343fce78 Mon Sep 17 00:00:00 2001 From: recall704 Date: Wed, 27 Dec 2017 09:43:20 +0800 Subject: [PATCH] return if error does not nil (#205) --- sni.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sni.go b/sni.go index 2cb9800..0cc6719 100644 --- a/sni.go +++ b/sni.go @@ -59,13 +59,13 @@ func (h *sniHandler) Handle(conn net.Conn) { if hdr[0] != dissector.Handshake { // We assume it is an HTTP request 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 { log.Logf("[sni] %s - %s : %s", conn.RemoteAddr(), conn.LocalAddr(), err) return } + if !req.URL.IsAbs() { + req.URL.Scheme = "http" // make sure that the URL is absolute + } HTTPHandler(h.options...).(*httpHandler).handleRequest(conn, req) return }