Commit c4407b75 authored by Russ Cox's avatar Russ Cox

http: close after responding to HTTP/1.0 request without Connection: keep-alive

R=adg
CC=golang-dev
https://golang.org/cl/4245065
parent 2ae4f356
...@@ -285,6 +285,9 @@ func (w *response) WriteHeader(code int) { ...@@ -285,6 +285,9 @@ func (w *response) WriteHeader(code int) {
if !connectionHeaderSet { if !connectionHeaderSet {
w.SetHeader("Connection", "keep-alive") w.SetHeader("Connection", "keep-alive")
} }
} else if !w.req.ProtoAtLeast(1, 1) {
// Client did not ask to keep connection alive.
w.closeAfterReply = true
} }
// Cannot use Content-Length with non-identity Transfer-Encoding. // Cannot use Content-Length with non-identity Transfer-Encoding.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment