return if error does not nil

This commit is contained in:
recall704 2017-12-26 19:48:01 +08:00 committed by GitHub
parent d11b16c758
commit b8e7baa2be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
sni.go
View File

@ -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
}