go/src
Brad Fitzpatrick a6557a05a0 net/http: allow Handlers to handle http2 upgrade PRI requests
The http2 spec defines a magic string which initates an http2 session:

    "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"

It was intentionally chosen to kinda look like an HTTP request, but
just different enough to break things not ready for it. This change
makes Go ready for it.

Notably: Go now accepts the request header (the prefix "PRI *
HTTP/2.0\r\n\r\n") as a valid request, even though it doesn't have a
Host header. But we now mark it as "Connection: close" and teach the
Server to never read a second request from the connection once that's
seen. If the http.Handler wants to deal with the upgrade, it has to
hijack the request, read out the "body", compare it against
"SM\r\n\r\n", and then speak http2. One of the new tests demonstrates
that hijacking.

Fixes #14451
Updates #14141 (h2c)

Change-Id: Ib46142f31c55be7d00c56fa2624ec8a232e00c43
Reviewed-on: https://go-review.googlesource.com/21327
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-31 06:12:36 +00:00
..
archive all: delete dead test code 2016-03-21 07:10:08 +00:00
bufio all: delete dead test code 2016-03-21 07:10:08 +00:00
builtin
bytes all: delete dead test code 2016-03-21 07:10:08 +00:00
cmd cmd/pprof: use DWARF info to lookup unknown PC addresses 2016-03-31 04:05:06 +00:00
compress compress/gzip: fix error handling in Read 2016-03-30 11:37:20 +00:00
container all: single space after period. 2016-03-02 00:13:47 +00:00
crypto all: use &^ operator if possible 2016-03-29 14:28:41 +00:00
database/sql all: delete dead non-test code 2016-03-25 06:28:13 +00:00
debug debug/elf: deflake file_test.go 2016-03-30 06:56:25 +00:00
encoding encoding/asn1: tags should be encoded in minimal form. 2016-03-25 22:07:54 +00:00
errors
expvar all: single space after period. 2016-03-02 00:13:47 +00:00
flag all: single space after period. 2016-03-02 00:13:47 +00:00
fmt fmt: fix padding for 0 precision 0 integer value formatting 2016-03-30 00:44:01 +00:00
go vendor: move golang.org/x/net/http2/hpack back to vendor 2016-03-24 20:26:51 +00:00
hash hash/crc32: use slicing by 8 for Castagnoli and smaller sizes 2016-03-08 16:46:24 +00:00
html all: delete dead non-test code 2016-03-25 06:28:13 +00:00
image image/jpeg: reconstruct progressive images even if incomplete. 2016-03-31 00:33:24 +00:00
index/suffixarray
internal internal/testenv: prefer to find go binary in GOROOT 2016-03-30 19:12:50 +00:00
io all: delete dead non-test code 2016-03-25 06:28:13 +00:00
log all: single space after period. 2016-03-02 00:13:47 +00:00
math math/big: much simplified and faster Float rounding 2016-03-22 17:07:34 +00:00
mime mime: fix maximum length of encoded-words 2016-03-29 11:19:31 +00:00
net net/http: allow Handlers to handle http2 upgrade PRI requests 2016-03-31 06:12:36 +00:00
os os: skip TestStatStdin on Android 2016-03-24 19:07:11 +00:00
path path/filepath: use fsutil with TestEvalSymlinksCanonicalNames 2016-03-29 05:02:40 +00:00
reflect reflect: test name data is aligned 2016-03-25 20:37:08 +00:00
regexp all: delete dead non-test code 2016-03-25 06:28:13 +00:00
runtime runtime: don't use REP;MOVSB if CPUID doesn't say it is fast 2016-03-31 02:54:10 +00:00
sort all: delete dead non-test code 2016-03-25 06:28:13 +00:00
strconv all: single space after period. 2016-03-02 00:13:47 +00:00
strings all: single space after period. 2016-03-02 00:13:47 +00:00
sync sync: don't assume b.N > 0 2016-03-18 16:37:39 +00:00
syscall all: use &^ operator if possible 2016-03-29 14:28:41 +00:00
testing cmd/go: fix proc-count accumulation in benchmark name 2016-03-26 16:44:01 +00:00
text all: delete dead non-test code 2016-03-25 06:28:13 +00:00
time all: delete dead non-test code 2016-03-25 06:28:13 +00:00
unicode all: single space after period. 2016-03-02 00:13:47 +00:00
unsafe all: single space after period. 2016-03-02 00:13:47 +00:00
vendor/golang.org/x/net/http2/hpack vendor: move golang.org/x/net/http2/hpack back to vendor 2016-03-24 20:26:51 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
iostest.bash
make.bash cmd/dist: redo flag-passing for bootstrap 2016-03-18 19:00:03 +00:00
make.bat
make.rc
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc