From: yazdan Date: Wed, 16 Jul 2025 08:12:54 +0000 (+0330) Subject: net/http: add proper panic message X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=10c5cf68d40e2b26336e4b4e59d4c2f3fc3f03b9;p=gostls13.git net/http: add proper panic message Change-Id: Ibfb330eaf24e004ddec60a5ca08cdc780235ad8c Reviewed-on: https://go-review.googlesource.com/c/go/+/688315 Reviewed-by: Damien Neil Auto-Submit: Damien Neil Reviewed-by: Mark Freeman LUCI-TryBot-Result: Go LUCI --- diff --git a/src/net/http/server.go b/src/net/http/server.go index 1ca5a227ef..cf0bd0a91d 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -1614,7 +1614,7 @@ func writeStatusLine(bw *bufio.Writer, is11 bool, code int, scratch []byte) { // It's illegal to call this before the header has been flushed. func (w *response) bodyAllowed() bool { if !w.wroteHeader { - panic("") + panic("net/http: bodyAllowed called before the header was written") } return bodyAllowedForStatus(w.status) }