This commit is contained in:
Jeff Becker 2019-01-19 08:43:14 -05:00
parent 939a8cee96
commit 0828fc3df1
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 1 additions and 1 deletions

View File

@ -46,13 +46,13 @@ func (h *httpProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
http.Error(w, "hijack disallowed", http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusOK)
conn, _, err := hijacker.Hijack()
if err != nil {
outConn.Close()
http.Error(w, err.Error(), http.StatusServiceUnavailable)
return
}
w.WriteHeader(http.StatusOK)
go transfer(conn, outConn)
go transfer(outConn, conn)
} else {