Skip to content

Commit

Permalink
Use original close conn value (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikPelli authored Dec 20, 2024
1 parent 009a1d3 commit 86a5c08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions https.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ func (proxy *ProxyHttpServer) handleHttps(w http.ResponseWriter, r *http.Request
req.URL, err = url.Parse("https://" + r.Host + req.URL.String())
}

// Take the original value before filtering the request
closeConn := req.Close

// Bug fix which goproxy fails to provide request
// information URL in the context when does HTTPS MITM
ctx.Req = req

req, resp := proxy.filterRequest(req, ctx)
if req == nil {
req = ctx.Req
}
if resp == nil {
if req.Method == "PRI" {
// Handle HTTP/2 connections.
Expand Down Expand Up @@ -384,7 +384,7 @@ func (proxy *ProxyHttpServer) handleHttps(w http.ResponseWriter, r *http.Request
}
}

if req.Close {
if closeConn {
ctx.Logf("Non-persistent connection; closing")
return
}
Expand Down

0 comments on commit 86a5c08

Please sign in to comment.