From 39117ef235a41b016e8f3dcd3ae052bef949f24f Mon Sep 17 00:00:00 2001 From: Vinicius Fortuna Date: Tue, 26 Sep 2023 18:07:44 -0400 Subject: [PATCH] Clarify if --- x/httpproxy/connect_handler.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x/httpproxy/connect_handler.go b/x/httpproxy/connect_handler.go index bcb85e3d..52aa9946 100644 --- a/x/httpproxy/connect_handler.go +++ b/x/httpproxy/connect_handler.go @@ -38,11 +38,12 @@ func (h *handler) ServeHTTP(proxyResp http.ResponseWriter, proxyReq *http.Reques if proxyReq.Method == http.MethodConnect { h.handleConnect(proxyResp, proxyReq) return - } else if proxyReq.URL.Host != "" { + } + if proxyReq.URL.Host != "" { h.handleHTTPProxyRequest(proxyResp, proxyReq) - } else { - http.Error(proxyResp, "Not Found", http.StatusNotFound) + return } + http.Error(proxyResp, "Not Found", http.StatusNotFound) } func (h *handler) handleHTTPProxyRequest(proxyResp http.ResponseWriter, proxyReq *http.Request) {