diff --git a/response_writer.go b/response_writer.go index a00bc7a4..6e0eb63b 100644 --- a/response_writer.go +++ b/response_writer.go @@ -108,6 +108,7 @@ func (w *responseWriter) Written() bool { } // Hijack implements the http.Hijacker interface. +// On error, the writer state is left unchanged so callers can send a fallback HTTP response. func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { // Allow hijacking before any data is written (size == -1) or after headers are written (size == 0), // but not after body data is written (size > 0). For compatibility with websocket libraries (e.g., github.com/coder/websocket)