HTTP keep-alive connections support.

This commit is contained in:
Igor Sysoev
2017-12-28 16:01:06 +03:00
parent 497faf1b9a
commit 9a6d3c5775
17 changed files with 2000 additions and 898 deletions

View File

@@ -54,7 +54,7 @@ func (r *response) WriteHeader(code int) {
return
}
r.headerSent = true
fmt.Fprintf(r, "%s %d %s\r\n", r.req.Proto, code, http.StatusText(code))
fmt.Fprintf(r, "Status: %d\r\n", code)
// Set a default Content-Type
if _, hasType := r.header["Content-Type"]; !hasType {