aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/http.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2016-03-31 00:06:27 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2016-04-01 00:47:25 +0000
commit36feb1a00aef40b793c173859aab49f8080b71fc (patch)
tree9f8d7d2aebb82de75260027e61ab3a02323cac2e /src/net/http/http.go
parent7a4211bc1f03672422ff0d761d3bf9d9f97b8997 (diff)
downloadgo-36feb1a00aef40b793c173859aab49f8080b71fc.tar.xz
net/http: limit Transport's reading of response header bytes from servers
The default is 10MB, like http2, but can be configured with a new field http.Transport.MaxResponseHeaderBytes. Fixes #9115 Change-Id: I01808ac631ce4794ef2b0dfc391ed51cf951ceb1 Reviewed-on: https://go-review.googlesource.com/21329 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'src/net/http/http.go')
-rw-r--r--src/net/http/http.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/net/http/http.go b/src/net/http/http.go
new file mode 100644
index 0000000000..a40b23dfdb
--- /dev/null
+++ b/src/net/http/http.go
@@ -0,0 +1,12 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package http
+
+// maxInt64 is the effective "infinite" value for the Server and
+// Transport's byte-limiting readers.
+const maxInt64 = 1<<63 - 1
+
+// TODO(bradfitz): move common stuff here. The other files have accumulated
+// generic http stuff in random places.