aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/http/server.go')
-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 1ff72a0455..1eb0e50206 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -611,7 +611,7 @@ func (w *response) ReadFrom(src io.Reader) (n int64, err error) {
w.cw.flush() // make sure Header is written; flush data to rwc
// Now that cw has been flushed, its chunking field is guaranteed initialized.
- if !w.cw.chunking && w.bodyAllowed() {
+ if !w.cw.chunking && w.bodyAllowed() && w.req.Method != "HEAD" {
n0, err := rf.ReadFrom(src)
n += n0
w.written += n0