aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/request.go
AgeCommit message (Collapse)Author
2015-07-28all: cleanup usage of dashes in package documentationMatthew Dempsky
Change-Id: I58453f7ed71eaca15dd3f501e4ae88d1fab19908 Reviewed-on: https://go-review.googlesource.com/12683 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Rob Pike <r@golang.org>
2015-07-15net/http: do not allow space or slash in Host headersJeff R. Allen
A malformed Host header can result in a malformed HTTP request. Clean them to avoid this. Updates #11206. We may come back and make this stricter for 1.6. Change-Id: I23c7d821cd9dbf66c3c15d26750f305e3672d984 Reviewed-on: https://go-review.googlesource.com/11241 Reviewed-by: Russ Cox <rsc@golang.org>
2015-07-07net/http: fix MaxBytesReader at EOFBrad Fitzpatrick
Fixes #10884 Change-Id: I7cab3c96548867612f579d2cd4ec736309787443 Reviewed-on: https://go-review.googlesource.com/11961 Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-06-30net/http: add a Request.Cancel channel.Aaron Jacobs
This allows for "race free" cancellation, in the sense discussed in issue #11013: in contrast to Transport.CancelRequest, the cancellation will not be lost if the user cancels before the request is put into the transport's internal map. Fixes #11013. Change-Id: I0b5e7181231bdd65d900e343f764b4d1d7c422cd Reviewed-on: https://go-review.googlesource.com/11601 Run-TryBot: David Symonds <dsymonds@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-26net/http: change default user agent stringAamir Khan
Default user agent in use - "Go 1.1 package http" doesn't conform to RFC 7231. See http://tools.ietf.org/html/rfc7231#section-5.5.3 Use a valid user-agent string instead. Fixes #9792 Change-Id: I80249709800dcdbf6f2e97a63fab05656898e6aa Reviewed-on: https://go-review.googlesource.com/9385 Reviewed-by: Russ Cox <rsc@golang.org>
2015-06-26net/http: add comment to exported ErrNoCookie and ErrNoLocation valuesMatt Layher
All other exported errors in net/http are commented. This change adds documentation to ErrNoCookie and ErrNoLocation to explain where they are returned, and why. Change-Id: I21fa0d070dd35256681ad0714000f238477d4af1 Reviewed-on: https://go-review.googlesource.com/11044 Reviewed-by: Russ Cox <rsc@golang.org>
2015-06-25net/http: bound the number of bytes read seeking EOF in Handler's Body.CloseBrad Fitzpatrick
If a client sent a POST with a huge request body, calling req.Body.Close in the handler (which is implicit at the end of a request) would end up consuming it all. Put a cap on that, using the same threshold used elsewhere for similar cases. Fixes #9662 Change-Id: I26628413aa5f623a96ef7c2609a8d03c746669e5 Reviewed-on: https://go-review.googlesource.com/11412 Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-06-25net/http: document that FormValue returns the empty stringBrad Fitzpatrick
Fixes #8137 Change-Id: Icd94bbe430a3ef333248425449b5fc678edb0343 Reviewed-on: https://go-review.googlesource.com/11410 Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-04-28net/http: documentation updatesBrad Fitzpatrick
Fixes #10366 (how to set custom headers) Fixes #9836 (PATCH in PostForm) Fixes #9276 (generating a server-side Request for testing) Update #8991 (clarify Response.Write for now; export ReverseProxy's copy later?) Change-Id: I95a11bf3bb3eeeeb72775b6ebfbc761641addc35 Reviewed-on: https://go-review.googlesource.com/9410 Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-04-09net/http: don't send IPv6 zone identifier in outbound request, per RFC 6874Mikio Hara
When making a request to an IPv6 address with a zone identifier, for exmaple [fe80::1%en0], RFC 6874 says HTTP clients must remove the zone identifier "%en0" before writing the request for security reason. This change removes any IPv6 zone identifer attached to URI in the Host header field in requests. Fixes #9544. Change-Id: I7406bd0aa961d260d96f1f887c2e45854e921452 Reviewed-on: https://go-review.googlesource.com/3111 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-22net/http: Removed some unused constants in request.go.Aaron Jacobs
Change-Id: I05cdf357249166a45105703e9317793aa2088844 Reviewed-on: https://go-review.googlesource.com/5560 Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-02-05net/http: Fix typo in MaxBytesReader commentErik Aigner
Change-Id: Ida064ff422d077d508ef94f52fc813daa6277a99 Reviewed-on: https://go-review.googlesource.com/3933 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-03net/http: remove redundant strings.TrimPrefixErik Aigner
We already checked for the prefix with strings.HasPrefix Change-Id: I33852fd19ffa92aa33b75b94b4bb505f4043a54a Reviewed-on: https://go-review.googlesource.com/3691 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-09-29net/http: clarify Request.FormValue docsBrad Fitzpatrick
Fixes #8067 LGTM=r R=r CC=golang-codereviews https://golang.org/cl/146480043
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.