Fix linter issues

This commit is contained in:
2026-05-27 10:58:13 +03:00
parent 11a357ebc4
commit 024d5fd96c
13 changed files with 145 additions and 46 deletions

View File

@@ -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)
}