Skip to content

Commit c877839

Browse files
elindseyneild
authored andcommitted
http2: add a few other common headers to the shared headermap cache
This change adds additional common CORS headers and two de-facto standard and common X- headers to the shared headermap cache to cut down on allocations from lower-casing/canonicalization. Change-Id: I61121925b0b28414ed6ce07190155662b0444f93 Reviewed-on: https://go-review.googlesource.com/c/net/+/442176 Auto-Submit: Damien Neil <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Damien Neil <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Damien Neil <[email protected]>
1 parent c630100 commit c877839

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

http2/headermap.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ func buildCommonHeaderMaps() {
2727
"accept-language",
2828
"accept-ranges",
2929
"age",
30+
"access-control-allow-credentials",
31+
"access-control-allow-headers",
32+
"access-control-allow-methods",
3033
"access-control-allow-origin",
34+
"access-control-expose-headers",
35+
"access-control-max-age",
36+
"access-control-request-headers",
37+
"access-control-request-method",
3138
"allow",
3239
"authorization",
3340
"cache-control",
@@ -53,6 +60,7 @@ func buildCommonHeaderMaps() {
5360
"link",
5461
"location",
5562
"max-forwards",
63+
"origin",
5664
"proxy-authenticate",
5765
"proxy-authorization",
5866
"range",
@@ -68,6 +76,8 @@ func buildCommonHeaderMaps() {
6876
"vary",
6977
"via",
7078
"www-authenticate",
79+
"x-forwarded-for",
80+
"x-forwarded-proto",
7181
}
7282
commonLowerHeader = make(map[string]string, len(common))
7383
commonCanonHeader = make(map[string]string, len(common))

0 commit comments

Comments
 (0)