Skip to content

Commit

Permalink
logging: fix typo and add debugging printouts
Browse files Browse the repository at this point in the history
Signed-off-by: Gaukas Wang <[email protected]>
  • Loading branch information
gaukas committed Jun 6, 2024
1 parent b1b2b88 commit 5c2e32e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modcaddy/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (h *Handler) Provision(ctx caddy.Context) error { // skipcq: GO-W1029

// ServeHTTP
func (h *Handler) ServeHTTP(wr http.ResponseWriter, req *http.Request, next caddyhttp.Handler) error { // skipcq: GO-W1029
h.logger.Debug("Sering HTTP to " + req.RemoteAddr + " on Protocol " + req.Proto)
h.logger.Debug("Serving HTTP to " + req.RemoteAddr + " on Protocol " + req.Proto)

if h.TLS && req.ProtoMajor <= 2 { // When TLS is enabled and for HTTP/1.0 or HTTP/1.1 or H2 served over TLS
return h.serveTLS(wr, req, next)
Expand Down Expand Up @@ -144,6 +144,7 @@ func (h *Handler) serveQUIC(wr http.ResponseWriter, req *http.Request, next cadd
var from string
if req.ProtoMajor == 3 {
from = req.RemoteAddr
h.logger.Debug(fmt.Sprintf("Fetching QUIC Fingerprint directly sent by QUIC client at %s", from))
} else {
// Get IP part of the RemoteAddr
ip, _, err := net.SplitHostPort(req.RemoteAddr)
Expand All @@ -159,6 +160,8 @@ func (h *Handler) serveQUIC(wr http.ResponseWriter, req *http.Request, next cadd
h.logger.Debug(fmt.Sprintf("Can't find last QUIC visitor for %s", ip))
return next.ServeHTTP(wr, req)
}

h.logger.Debug(fmt.Sprintf("Fetching most recent QUIC Fingerprint sent by %s for TLS client at %s", from, req.RemoteAddr))
}

// get the client hello from the reservoir
Expand Down

0 comments on commit 5c2e32e

Please sign in to comment.