Commit d4a8828e authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

vendor: update golang.org/x/net/http2/hpack

Updates golang.org/x/net/http2/hpack to x/net git rev 4dbf598 for:

   http2/hpack: remove unused pair function from package
   https://golang.org/cl/43851

   http2/hpack: remove pair function and initialize directly
   https://golang.org/cl/43190

   http2/hpack: move initialization to a static table
   https://golang.org/cl/43090

Updates #6853

Change-Id: I933a094623143c7333a0da7867d5d2e41da05234
Reviewed-on: https://go-review.googlesource.com/44007
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarTom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent e6e6cad6
......@@ -648,6 +648,10 @@ func TestHuffmanFuzzCrash(t *testing.T) {
}
}
func pair(name, value string) HeaderField {
return HeaderField{Name: name, Value: value}
}
func dehex(s string) []byte {
s = strings.Replace(s, " ", "", -1)
s = strings.Replace(s, "\n", "", -1)
......
......@@ -125,77 +125,78 @@ func (t *headerFieldTable) idToIndex(id uint64) uint64 {
return k + 1
}
func pair(name, value string) HeaderField {
return HeaderField{Name: name, Value: value}
}
// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B
var staticTable = newStaticTable()
var staticTableEntries = [...]HeaderField{
HeaderField{Name: ":authority"},
HeaderField{Name: ":method", Value: "GET"},
HeaderField{Name: ":method", Value: "POST"},
HeaderField{Name: ":path", Value: "/"},
HeaderField{Name: ":path", Value: "/index.html"},
HeaderField{Name: ":scheme", Value: "http"},
HeaderField{Name: ":scheme", Value: "https"},
HeaderField{Name: ":status", Value: "200"},
HeaderField{Name: ":status", Value: "204"},
HeaderField{Name: ":status", Value: "206"},
HeaderField{Name: ":status", Value: "304"},
HeaderField{Name: ":status", Value: "400"},
HeaderField{Name: ":status", Value: "404"},
HeaderField{Name: ":status", Value: "500"},
HeaderField{Name: "accept-charset"},
HeaderField{Name: "accept-encoding", Value: "gzip, deflate"},
HeaderField{Name: "accept-language"},
HeaderField{Name: "accept-ranges"},
HeaderField{Name: "accept"},
HeaderField{Name: "access-control-allow-origin"},
HeaderField{Name: "age"},
HeaderField{Name: "allow"},
HeaderField{Name: "authorization"},
HeaderField{Name: "cache-control"},
HeaderField{Name: "content-disposition"},
HeaderField{Name: "content-encoding"},
HeaderField{Name: "content-language"},
HeaderField{Name: "content-length"},
HeaderField{Name: "content-location"},
HeaderField{Name: "content-range"},
HeaderField{Name: "content-type"},
HeaderField{Name: "cookie"},
HeaderField{Name: "date"},
HeaderField{Name: "etag"},
HeaderField{Name: "expect"},
HeaderField{Name: "expires"},
HeaderField{Name: "from"},
HeaderField{Name: "host"},
HeaderField{Name: "if-match"},
HeaderField{Name: "if-modified-since"},
HeaderField{Name: "if-none-match"},
HeaderField{Name: "if-range"},
HeaderField{Name: "if-unmodified-since"},
HeaderField{Name: "last-modified"},
HeaderField{Name: "link"},
HeaderField{Name: "location"},
HeaderField{Name: "max-forwards"},
HeaderField{Name: "proxy-authenticate"},
HeaderField{Name: "proxy-authorization"},
HeaderField{Name: "range"},
HeaderField{Name: "referer"},
HeaderField{Name: "refresh"},
HeaderField{Name: "retry-after"},
HeaderField{Name: "server"},
HeaderField{Name: "set-cookie"},
HeaderField{Name: "strict-transport-security"},
HeaderField{Name: "transfer-encoding"},
HeaderField{Name: "user-agent"},
HeaderField{Name: "vary"},
HeaderField{Name: "via"},
HeaderField{Name: "www-authenticate"},
}
func newStaticTable() *headerFieldTable {
t := &headerFieldTable{}
t.init()
t.addEntry(pair(":authority", ""))
t.addEntry(pair(":method", "GET"))
t.addEntry(pair(":method", "POST"))
t.addEntry(pair(":path", "/"))
t.addEntry(pair(":path", "/index.html"))
t.addEntry(pair(":scheme", "http"))
t.addEntry(pair(":scheme", "https"))
t.addEntry(pair(":status", "200"))
t.addEntry(pair(":status", "204"))
t.addEntry(pair(":status", "206"))
t.addEntry(pair(":status", "304"))
t.addEntry(pair(":status", "400"))
t.addEntry(pair(":status", "404"))
t.addEntry(pair(":status", "500"))
t.addEntry(pair("accept-charset", ""))
t.addEntry(pair("accept-encoding", "gzip, deflate"))
t.addEntry(pair("accept-language", ""))
t.addEntry(pair("accept-ranges", ""))
t.addEntry(pair("accept", ""))
t.addEntry(pair("access-control-allow-origin", ""))
t.addEntry(pair("age", ""))
t.addEntry(pair("allow", ""))
t.addEntry(pair("authorization", ""))
t.addEntry(pair("cache-control", ""))
t.addEntry(pair("content-disposition", ""))
t.addEntry(pair("content-encoding", ""))
t.addEntry(pair("content-language", ""))
t.addEntry(pair("content-length", ""))
t.addEntry(pair("content-location", ""))
t.addEntry(pair("content-range", ""))
t.addEntry(pair("content-type", ""))
t.addEntry(pair("cookie", ""))
t.addEntry(pair("date", ""))
t.addEntry(pair("etag", ""))
t.addEntry(pair("expect", ""))
t.addEntry(pair("expires", ""))
t.addEntry(pair("from", ""))
t.addEntry(pair("host", ""))
t.addEntry(pair("if-match", ""))
t.addEntry(pair("if-modified-since", ""))
t.addEntry(pair("if-none-match", ""))
t.addEntry(pair("if-range", ""))
t.addEntry(pair("if-unmodified-since", ""))
t.addEntry(pair("last-modified", ""))
t.addEntry(pair("link", ""))
t.addEntry(pair("location", ""))
t.addEntry(pair("max-forwards", ""))
t.addEntry(pair("proxy-authenticate", ""))
t.addEntry(pair("proxy-authorization", ""))
t.addEntry(pair("range", ""))
t.addEntry(pair("referer", ""))
t.addEntry(pair("refresh", ""))
t.addEntry(pair("retry-after", ""))
t.addEntry(pair("server", ""))
t.addEntry(pair("set-cookie", ""))
t.addEntry(pair("strict-transport-security", ""))
t.addEntry(pair("transfer-encoding", ""))
t.addEntry(pair("user-agent", ""))
t.addEntry(pair("vary", ""))
t.addEntry(pair("via", ""))
t.addEntry(pair("www-authenticate", ""))
for _, e := range staticTableEntries[:] {
t.addEntry(e)
}
return t
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment