aboutsummaryrefslogtreecommitdiff
path: root/src/net/http
diff options
context:
space:
mode:
authoryazdan <m.hossein95th@gmail.com>2025-07-16 11:42:54 +0330
committerGopher Robot <gobot@golang.org>2025-07-28 11:02:55 -0700
commit10c5cf68d40e2b26336e4b4e59d4c2f3fc3f03b9 (patch)
tree4836ac2ea6887d097106eb2a802ebe0534705434 /src/net/http
parent46b5839231381e8b36eab10ba9b2c37ba579a75d (diff)
downloadgo-10c5cf68d40e2b26336e4b4e59d4c2f3fc3f03b9.tar.xz
net/http: add proper panic message
Change-Id: Ibfb330eaf24e004ddec60a5ca08cdc780235ad8c Reviewed-on: https://go-review.googlesource.com/c/go/+/688315 Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Mark Freeman <mark@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/net/http')
-rw-r--r--src/net/http/server.go2
1 files changed, 1 insertions, 1 deletions
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)
}