Fix linter issues
This commit is contained in:
@@ -2,15 +2,15 @@ package deconnector
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
func (d *Deconnector) handleDeconnect(clientConn net.Conn, connectReq *http.Request, upstreamURL *url.URL) {
|
||||
func (d *Deconnector) handleDeconnect(ctx context.Context, clientConn net.Conn, connectReq *http.Request) {
|
||||
// Tell client the tunnel is open
|
||||
fmt.Fprintf(clientConn, "HTTP/1.1 200 Connection established\r\n\r\n")
|
||||
_, _ = fmt.Fprintf(clientConn, "HTTP/1.1 200 Connection established\r\n\r\n")
|
||||
|
||||
// Read the real HTTP request the client sends through the tunnel
|
||||
innerReq, err := http.ReadRequest(bufio.NewReader(clientConn))
|
||||
@@ -30,5 +30,5 @@ func (d *Deconnector) handleDeconnect(clientConn net.Conn, connectReq *http.Requ
|
||||
WithField("url", innerReq.URL).
|
||||
Info("Handling de-CONNECT request")
|
||||
|
||||
d.forwardHTTP(clientConn, innerReq, upstreamURL)
|
||||
d.forwardHTTP(ctx, clientConn, innerReq)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user