mirror of
https://github.com/golang/go.git
synced 2026-02-04 18:05:03 +03:00
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>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user