From 050d137e76b99cfd70cbc70a0850c8674b92e0a4 Mon Sep 17 00:00:00 2001 From: WeidiDeng Date: Tue, 21 Apr 2026 14:55:56 +0800 Subject: [PATCH] change the log level if hijacking without writing a status code first --- modules/caddyhttp/responsewriter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/caddyhttp/responsewriter.go b/modules/caddyhttp/responsewriter.go index a477c7abe..c593c6162 100644 --- a/modules/caddyhttp/responsewriter.go +++ b/modules/caddyhttp/responsewriter.go @@ -272,8 +272,8 @@ func (rr *responseRecorder) Hijack() (net.Conn, *bufio.ReadWriter, error) { if !rr.wroteHeader { // hijacking without writing status code first works as long as subsequent writes follows http1.1 // wire format, but it will show up with a status code of 0 in the access log and bytes written - // will include response headers. - caddy.Log().Debug("hijacking without writing status code first") + // will include response headers. Response headers won't be present in the log if not set on the response writer. + caddy.Log().Warn("hijacking without writing status code first") } //nolint:bodyclose conn, brw, err := http.NewResponseController(rr.ResponseWriterWrapper).Hijack()