HTTP proxy 24 hours timeout, fix #303

This commit is contained in:
Quentin McGaw
2020-11-21 01:26:02 +00:00
parent 1cc0f5fee9
commit fb62910b17
6 changed files with 17 additions and 28 deletions

View File

@@ -1,7 +1,6 @@
package httpproxy
import (
"context"
"fmt"
"io"
"net"
@@ -18,9 +17,7 @@ func (h *handler) handleHTTP(responseWriter http.ResponseWriter, request *http.R
return
}
ctx, cancel := context.WithTimeout(h.ctx, h.relayTimeout)
defer cancel()
request = request.WithContext(ctx)
request = request.WithContext(h.ctx)
request.RequestURI = ""