aboutsummaryrefslogtreecommitdiff
path: root/src/net/http
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2016-04-30 17:29:28 -0500
committerBrad Fitzpatrick <bradfitz@golang.org>2016-04-30 23:36:35 +0000
commit38cfaa5f0ac1e8b9c7528649f01e4b0edcd4a788 (patch)
treedb054ab2b4d4e7ba62de9f9ce42ea175021c6790 /src/net/http
parent4e0cd1eeef419b221fda3dd3966be71095f0b4ce (diff)
downloadgo-38cfaa5f0ac1e8b9c7528649f01e4b0edcd4a788.tar.xz
net/http: expand documentation of Server.MaxHeaderBytes
Clarify that it includes the RFC 7230 "request-line". Fixes #15494 Change-Id: I9cc5dd5f2d85ebf903229539208cec4da5c38d04 Reviewed-on: https://go-review.googlesource.com/22656 Reviewed-by: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'src/net/http')
-rw-r--r--src/net/http/server.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/net/http/server.go b/src/net/http/server.go
index da17fccbae..8b12e366f9 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -2031,12 +2031,18 @@ func Serve(l net.Listener, handler Handler) error {
// A Server defines parameters for running an HTTP server.
// The zero value for Server is a valid configuration.
type Server struct {
- Addr string // TCP address to listen on, ":http" if empty
- Handler Handler // handler to invoke, http.DefaultServeMux if nil
- ReadTimeout time.Duration // maximum duration before timing out read of the request
- WriteTimeout time.Duration // maximum duration before timing out write of the response
- MaxHeaderBytes int // maximum size of request headers, DefaultMaxHeaderBytes if 0
- TLSConfig *tls.Config // optional TLS config, used by ListenAndServeTLS
+ Addr string // TCP address to listen on, ":http" if empty
+ Handler Handler // handler to invoke, http.DefaultServeMux if nil
+ ReadTimeout time.Duration // maximum duration before timing out read of the request
+ WriteTimeout time.Duration // maximum duration before timing out write of the response
+ TLSConfig *tls.Config // optional TLS config, used by ListenAndServeTLS
+
+ // MaxHeaderBytes controls the maximum number of bytes the
+ // server will read parsing the request header's keys and
+ // values, including the request line. It does not limit the
+ // size of the request body.
+ // If zero, DefaultMaxHeaderBytes is used.
+ MaxHeaderBytes int
// TLSNextProto optionally specifies a function to take over
// ownership of the provided TLS connection when an NPN