mirror of
https://github.com/gin-gonic/gin.git
synced 2026-11-22 02:43:36 +08:00
docs(response): clarify Hijack writer state behavior
This commit is contained in:
parent
649e321fc7
commit
671f6b691c
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user