From 509c265a3d27b9214feb0193c2e841a1f5f3bd31 Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Mon, 5 May 2025 15:28:59 -0400 Subject: [PATCH] add more logging to AddHeaders --- mirror/header.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mirror/header.go b/mirror/header.go index 91d7f8e..34f4d36 100644 --- a/mirror/header.go +++ b/mirror/header.go @@ -17,6 +17,8 @@ func AddHeaders(conn net.Conn, headers map[string]string) net.Conn { // if the request is not an HTTP request, return the connection as is req, err := http.ReadRequest(bufio.NewReader(conn)) if err != nil { + log.Println("Error reading request:", err) + // if the request is not an HTTP request, return the connection as is return conn } log.Println("Adding headers to connection:", req.Method, req.URL) @@ -26,9 +28,11 @@ func AddHeaders(conn net.Conn, headers map[string]string) net.Conn { } // write the request back to the connection if err := req.Write(conn); err != nil { + log.Println("Error writing request:", err) + // if there is an error writing the request, return the connection as is return conn } - // return the connection with the headers added + // If all goes well, return the connection with the headers added return conn }