Skip to content

Commit 21a7e8a

Browse files
authored
refactor: remove commented out code (#96)
1 parent dad4a41 commit 21a7e8a

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

proxy/proxy.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -298,22 +298,6 @@ func (p *Server) forwardRequest(conn net.Conn, req *http.Request, https bool) {
298298
RawQuery: req.URL.RawQuery,
299299
}
300300

301-
//var requestBodyBytes []byte
302-
//{
303-
// var err error
304-
// requestBodyBytes, err = io.ReadAll(req.Body)
305-
// if err != nil {
306-
// p.logger.Error("can't read response body", "error", err)
307-
// return
308-
// }
309-
// err = req.Body.Close()
310-
// if err != nil {
311-
// p.logger.Error("Failed to close HTTP response body", "error", err)
312-
// return
313-
// }
314-
// req.Body = io.NopCloser(bytes.NewBuffer(requestBodyBytes))
315-
//}
316-
317301
var body = req.Body
318302
if req.Method == http.MethodGet || req.Method == http.MethodHead {
319303
body = nil
@@ -347,12 +331,8 @@ func (p *Server) forwardRequest(conn net.Conn, req *http.Request, https bool) {
347331
p.logger.Debug("Forwarded Request",
348332
"method", newReq.Method,
349333
"host", newReq.Host,
350-
//"requestBodyBytes", string(requestBodyBytes),
351334
"URL", newReq.URL,
352335
)
353-
//for hKey, hVal := range newReq.Header {
354-
// p.logger.Debug("Forwarded Request Header", hKey, hVal)
355-
//}
356336

357337
// Read the body and explicitly set Content-Length header, otherwise client can hung up on the request.
358338
bodyBytes, err := io.ReadAll(resp.Body)

0 commit comments

Comments
 (0)