]> Cypherpunks repositories - gostls13.git/commit
net/http: conditionally configure HTTP/2 in Server.Serve(Listener)
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 27 Jun 2016 23:39:40 +0000 (16:39 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 28 Jun 2016 18:14:56 +0000 (18:14 +0000)
commitb5f0aff49503e31002b33198e06708e263c445a7
tree3e1c33f5ba496a71698ec6d242c97a6e48ac43a6
parent996ed3be9a10ace6cd7a8a6a8080c0c8db7ab1fe
net/http: conditionally configure HTTP/2 in Server.Serve(Listener)

Don't configure HTTP/2 in http.Server.Serve(net.Listener) if the
Server's TLSConfig is set and doesn't include the "h2" NextProto
value. This avoids mutating a *tls.Config already in use if
previously passed to tls.NewListener.

Also document this. (it's come up a few times now)

Fixes #15908

Change-Id: I283eed82fdb29a791f80d801aadd9f75db244de0
Reviewed-on: https://go-review.googlesource.com/24508
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/http/serve_test.go
src/net/http/server.go