diff --git a/proxy/proxy.go b/proxy/proxy.go index 6ec19d1..52659cf 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -82,10 +82,6 @@ func (p *Proxy) checkHttpBasicAuth(auth string) bool { } func (p *Proxy) handle(w http.ResponseWriter, r *http.Request) error { - if r.Method == "CONNECT" { - return p.handleConnect(w, r) - } - // TODO: only HTTPS? if p.user != "" { if !p.checkHttpBasicAuth(r.Header.Get("Proxy-Authorization")) { @@ -95,6 +91,10 @@ func (p *Proxy) handle(w http.ResponseWriter, r *http.Request) error { } } + if r.Method == "CONNECT" { + return p.handleConnect(w, r) + } + resp, err := forward(r) if err != nil { w.WriteHeader(http.StatusInternalServerError)