aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/http
AgeCommit message (Collapse)Author
2011-11-03net: renamingsRob Pike
This is Go 1 package renaming CL #3. This one merely moves the source; the import strings will be changed after the next weekly release. This one moves pieces into net. http -> net/http http/cgi -> net/http/cgi http/fcgi -> net/http/fcgi http/pprof -> net/http/pprof http/httptest -> net/http/httptest mail -> net/mail rpc -> net/rpc rpc/jsonrpc -> net/rpc/jsonrpc smtp -> net/smtp url -> net/url Also remove rand (now math/rand) from NOTEST - it has a test. The only edits are in Makefiles and deps.bash. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5335048
2011-11-03http: don't use ClientConn in TransportBrad Fitzpatrick
ClientConn's main feature (pipelining support) wasn't being used anyway. Ends up simpler to just not use it. This is prep for the http diet, moving ClientConn, ServerConn, etc into http/httputil. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5305088
2011-11-03http: update mime sniffing doc reference.David Symonds
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5303095
2011-11-02all: sort importsRuss Cox
R=golang-dev, r CC=golang-dev https://golang.org/cl/5319072
2011-11-01src/pkg/[a-m]*: gofix -r error -force=errorRuss Cox
R=golang-dev, iant CC=golang-dev https://golang.org/cl/5322051
2011-11-01http: avoid name error in testRuss Cox
R=adg CC=golang-dev https://golang.org/cl/5316070
2011-10-26redo CL 5302057 / dac58d9c9e4aAndrew Gerrand
««« original CL description http: remove Connection header in ReverseProxy Fixes #2342 R=golang-dev, adg CC=golang-dev https://golang.org/cl/5302057 »»» R=bradfitz, dsymonds CC=golang-dev https://golang.org/cl/5296055
2011-10-25cgo, goyacc, go/build, html, http, path, path/filepath, testing/quick, test: ↵Russ Cox
use rune Nothing terribly interesting here. R=golang-dev, bradfitz, gri, r CC=golang-dev https://golang.org/cl/5300043
2011-10-26undo CL 5302057 / dac58d9c9e4aAndrew Gerrand
need a clean base from weekly.2011-10-25 for rune change ««« original CL description http: remove Connection header in ReverseProxy Fixes #2342 R=golang-dev, adg CC=golang-dev https://golang.org/cl/5302057 »»» R=rsc CC=golang-dev https://golang.org/cl/5294068
2011-10-25http: remove Connection header in ReverseProxyBrad Fitzpatrick
Fixes #2342 R=golang-dev, adg CC=golang-dev https://golang.org/cl/5302057
2011-10-24http: doc typoBrad Fitzpatrick
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5303067
2011-10-24http: add package commentBrad Fitzpatrick
Fixes #2378 R=rsc CC=golang-dev https://golang.org/cl/5312052
2011-10-21http: Transport: with TLS InsecureSkipVerify, skip hostname checkBrad Fitzpatrick
Fixes #2386 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5312045
2011-10-19http: comment tweaksBrad Fitzpatrick
It hasn't been primitive in a while. R=golang-dev, adg CC=golang-dev https://golang.org/cl/5287041
2011-10-19http: add test for panic inside hijacked requestAndrew Gerrand
R=golang-dev, rsc, rsc CC=golang-dev https://golang.org/cl/5283052
2011-10-18http, crypto/tls: fix read timeouts and closing.Adam Langley
tls.Conn.Close() didn't close the underlying connection and tried to do a handshake in order to send the close notify alert. http didn't look for errors from the TLS handshake. Fixes #2281. R=bradfitz CC=golang-dev https://golang.org/cl/5283045
2011-10-18gofix -r mapdeleteRuss Cox
R=golang-dev, r, adg, r, cw CC=golang-dev https://golang.org/cl/5266045
2011-10-17http: do not depend on map iteration orderRuss Cox
R=golang-dev, r CC=golang-dev https://golang.org/cl/5284050
2011-10-17http: fix panic when recovering from hijacked connection panicAndrew Gerrand
Fixes #2375. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5279049
2011-10-14http: DoS protection: cap non-Handler Request.Body readsBrad Fitzpatrick
Previously, if an http.Handler didn't fully consume a Request.Body before returning and the request and the response from the handler indicated no reason to close the connection, the server would read an unbounded amount of the request's unread body to advance past the request message to find the next request's header. That was a potential DoS. With this CL there's a threshold under which we read (currently 256KB) in order to keep the connection in keep-alive mode, but once we hit that, we instead switch into a "Connection: close" response and don't read the request body. Fixes #2093 (along with number of earlier CLs) R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5268043
2011-10-14http: avoid panic caused by nil URLAnthony Martin
The current code will panic if an invalid request (one with a nil URL) is passed to the doFollowingRedirects function. Also, remove a redundant nil Header check. R=bradfitz CC=golang-dev https://golang.org/cl/5270046
2011-10-14http: RoundTrippers shouldn't mutate RequestBrad Fitzpatrick
Fixes #2146 R=rsc CC=golang-dev https://golang.org/cl/5284041
2011-10-14http: shut up a false Transport warning on WindowsBrad Fitzpatrick
Fixes #2057 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5269044
2011-10-13crypto/tls: fetch root certificates using Mac OS APIMikkel Krautz
Fixes #1009. R=adg, rsc CC=golang-dev https://golang.org/cl/5262041
2011-10-12http: remove Request.RawURLBrad Fitzpatrick
Its purpose is not only undocumented, it's also unknown (to me and Russ, at least) and leads to complexity, bugs and confusion. R=golang-dev, adg, rsc CC=golang-dev https://golang.org/cl/5213043
2011-10-11exp/spdy: move http/spdy to exp/spdyBrad Fitzpatrick
R=golang-dev, r CC=golang-dev https://golang.org/cl/5238051
2011-10-09http: cancel test timers; don't t.Fatalf in other goroutinesBrad Fitzpatrick
R=rsc CC=golang-dev https://golang.org/cl/5228041
2011-10-03strings: implement a faster byte->string ReplacerBrad Fitzpatrick
This implements a replacer for when all old strings are single bytes, but new values are not. BenchmarkHTMLEscapeNew 1000000 1090 ns/op BenchmarkHTMLEscapeOld 1000000 2049 ns/op R=rsc CC=golang-dev https://golang.org/cl/5176043
2011-10-03strings: implement a faster byte->byte ReplacerBrad Fitzpatrick
When all old & new string values are single bytes, byteReplacer is now used, instead of the generic algorithm. BenchmarkGenericMatch 10000 102519 ns/op BenchmarkByteByteMatch 1000000 2178 ns/op fast path, when nothing matches: BenchmarkByteByteNoMatch 1000000 1109 ns/op comparisons to multiple Replace calls: BenchmarkByteByteReplaces 100000 16164 ns/op comparison to strings.Map: BenchmarkByteByteMap 500000 5454 ns/op R=rsc CC=golang-dev https://golang.org/cl/5175050
2011-09-30io: rename Copyn to CopyN.David Symonds
R=golang-dev, r CC=golang-dev https://golang.org/cl/5157045
2011-09-28http: don't send a 400 Bad Request after a client shutdownBrad Fitzpatrick
Fixes #2312 R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5143049
2011-09-23http: add Location method to ResponseBrad Fitzpatrick
Fixes #2300 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5117041
2011-09-21http: add a (disabled) test for TLS handshake timeoutsBrad Fitzpatrick
It's currently broken and disabled, pending a fix for Issue 2281. R=golang-dev, adg CC=golang-dev https://golang.org/cl/5092045
2011-09-20httptest: add NewUnstartedServerBrad Fitzpatrick
This allows testing TLS with different http.Server options (timeouts, limits). R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5094043
2011-09-19http: fix TLS handshake blocking server accept loopBrad Fitzpatrick
Fixes #2263 R=golang-dev, adg CC=golang-dev https://golang.org/cl/5076042
2011-09-19http: always include Content-Length header, even for 0Dave Grijalva
fixes #2221 R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/4952052
2011-09-19http: prevent DumpRequest from adding implicit headersBrad Fitzpatrick
Fixes #2272 R=rsc CC=golang-dev https://golang.org/cl/5043051
2011-09-19http: check explicit wrong Request.ContentLength valuesBrad Fitzpatrick
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5070041
2011-09-16http/cgi: clean up environment.Yasuhiro Matsumoto
clean up duplicate environment for CGI. overriding former by latter. On windows, When there are duplicated environments like following, SCRIPT_FILENAME=c:/progra~1/php/php-cgi.exe SCRIPT_FILENAME=/foo.php CreateProcess use first entry. If make cgi.Handle like following, cgih = cgi.Handler{ Path: "c:/strawberry/perl/bin/perl.exe", Dir: "c:/path/to/webroot", Root: "c:/path/to/webroot", Args: []string{"foo.php"}, Env: []string{"SCRIPT_FILENAME=foo.php"}, } http/cgi should behave "SCRIPT_FILENAME is foo.php". But currently, http/cgi is set duplicate environment entries. So, browser show binary dump of "php-cgi.exe" that is specified indented SCRIPT_FILENAME in first entry. This change clean up duplicates, and use latters. R=golang-dev, bradfitz, bradfitz CC=golang-dev https://golang.org/cl/5010044
2011-09-15http: MaxBytesReader doc cleanupsBrad Fitzpatrick
Comments from rsc after 4921049 was submitted. R=rsc CC=golang-dev https://golang.org/cl/5034042
2011-09-15http: document that Response.Body is non-nilBrad Fitzpatrick
Fixes #2208 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5011051
2011-09-15http/cgi: add openbsd environment configurationBrad Fitzpatrick
R=iant, iant CC=golang-dev https://golang.org/cl/5016051
2011-09-15http: fix WriteProxy documentationBrad Fitzpatrick
Fixes #2258 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5016048
2011-09-13http: Alphabetize imports.Ian Lance Taylor
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5002043
2011-09-12time: make Weekday a method.Rob Pike
Weekday is redundant information for a Time structure. When parsing a time with a weekday specified, it can create an incorrect Time value. When parsing a time without a weekday specified, people expect the weekday to be set. Fix all three problems by computing the weekday on demand. This is hard to gofix, since we must change the type of the node. Since uses are rare and existing code will be caught by the compiler, there is no gofix module here. Fixes #2245. R=golang-dev, bradfitz, rsc CC=golang-dev https://golang.org/cl/4974077
2011-09-06cleanup: gofmt -s -w src miscRobert Griesemer
R=r CC=golang-dev https://golang.org/cl/4984052
2011-09-06url: handle ; in ParseQueryRuss Cox
Most web frameworks allow ; as a synonym for &, following a recommendation in some versions of the HTML specification. Do the same. Remove overuse of Split. Move ParseQuery tests from package http to package url. Fixes #2210. R=golang-dev, r CC=golang-dev https://golang.org/cl/4973062
2011-08-30http: add file protocol transportBrad Fitzpatrick
Off by default (security risk), but users can wire it up if desired. Fixes #2113 R=rsc, bradfitz CC=golang-dev https://golang.org/cl/4959049
2011-08-26http: support setting Transport's TLS client configBrad Fitzpatrick
R=golang-dev, adg CC=golang-dev https://golang.org/cl/4964043
2011-08-25http: return 413 instead of 400 when the request body is too largeDave Cheney
RFC2616 says servers should return this status code when rejecting requests that are too large. http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14 R=bradfitz CC=golang-dev https://golang.org/cl/4962041