/src/h2o/lib/common/token_table.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2014 DeNA Co., Ltd. |
3 | | * |
4 | | * Permission is hereby granted, free of charge, to any person obtaining a copy |
5 | | * of this software and associated documentation files (the "Software"), to |
6 | | * deal in the Software without restriction, including without limitation the |
7 | | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
8 | | * sell copies of the Software, and to permit persons to whom the Software is |
9 | | * furnished to do so, subject to the following conditions: |
10 | | * |
11 | | * The above copyright notice and this permission notice shall be included in |
12 | | * all copies or substantial portions of the Software. |
13 | | * |
14 | | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
15 | | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
16 | | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
17 | | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
18 | | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
19 | | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
20 | | * IN THE SOFTWARE. |
21 | | */ |
22 | | |
23 | | /* DO NOT EDIT! generated by tokens.pl */ |
24 | | h2o_token_t h2o__tokens[] = {{{H2O_STRLIT(":authority")}, {1, 0, 0, 0, 0, 0, 0, 1}}, |
25 | | {{H2O_STRLIT(":method")}, {2, 0, 0, 0, 0, 0, 0, 0}}, |
26 | | {{H2O_STRLIT(":path")}, {4, 0, 0, 0, 0, 0, 0, 0}}, |
27 | | {{H2O_STRLIT(":protocol")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
28 | | {{H2O_STRLIT(":scheme")}, {6, 0, 0, 0, 0, 0, 0, 0}}, |
29 | | {{H2O_STRLIT(":status")}, {8, 0, 0, 0, 0, 0, 0, 0}}, |
30 | | {{H2O_STRLIT("accept")}, {19, 0, 0, 0, 0, 1, 0, 1}}, |
31 | | {{H2O_STRLIT("accept-charset")}, {15, 0, 0, 0, 0, 1, 0, 1}}, |
32 | | {{H2O_STRLIT("accept-encoding")}, {16, 0, 0, 0, 0, 1, 0, 1}}, |
33 | | {{H2O_STRLIT("accept-language")}, {17, 0, 0, 0, 0, 1, 0, 1}}, |
34 | | {{H2O_STRLIT("accept-ranges")}, {18, 0, 0, 0, 0, 0, 0, 1}}, |
35 | | {{H2O_STRLIT("access-control-allow-credentials")}, {0, 0, 0, 0, 0, 0, 0, 0}}, |
36 | | {{H2O_STRLIT("access-control-allow-headers")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
37 | | {{H2O_STRLIT("access-control-allow-methods")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
38 | | {{H2O_STRLIT("access-control-allow-origin")}, {20, 0, 0, 0, 0, 0, 0, 1}}, |
39 | | {{H2O_STRLIT("access-control-expose-headers")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
40 | | {{H2O_STRLIT("access-control-request-headers")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
41 | | {{H2O_STRLIT("access-control-request-method")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
42 | | {{H2O_STRLIT("age")}, {21, 0, 0, 0, 0, 0, 0, 0}}, |
43 | | {{H2O_STRLIT("allow")}, {22, 0, 0, 0, 0, 0, 0, 1}}, |
44 | | {{H2O_STRLIT("alt-svc")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
45 | | {{H2O_STRLIT("authorization")}, {23, 0, 0, 0, 0, 0, 0, 0}}, |
46 | | {{H2O_STRLIT("cache-control")}, {24, 0, 0, 0, 0, 0, 0, 1}}, |
47 | | {{H2O_STRLIT("cache-digest")}, {0, 0, 0, 0, 1, 0, 0, 0}}, |
48 | | {{H2O_STRLIT("connection")}, {0, 1, 1, 0, 1, 0, 0, 0}}, |
49 | | {{H2O_STRLIT("content-disposition")}, {25, 0, 0, 0, 0, 0, 0, 1}}, |
50 | | {{H2O_STRLIT("content-encoding")}, {26, 0, 0, 0, 0, 0, 0, 1}}, |
51 | | {{H2O_STRLIT("content-language")}, {27, 0, 0, 0, 0, 0, 0, 1}}, |
52 | | {{H2O_STRLIT("content-length")}, {28, 0, 0, 1, 1, 0, 0, 0}}, |
53 | | {{H2O_STRLIT("content-location")}, {29, 0, 0, 0, 0, 0, 0, 0}}, |
54 | | {{H2O_STRLIT("content-range")}, {30, 0, 0, 0, 0, 0, 0, 0}}, |
55 | | {{H2O_STRLIT("content-security-policy")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
56 | | {{H2O_STRLIT("content-type")}, {31, 0, 0, 0, 0, 0, 0, 1}}, |
57 | | {{H2O_STRLIT("cookie")}, {32, 0, 0, 0, 0, 0, 1, 0}}, |
58 | | {{H2O_STRLIT("datagram-flow-id")}, {0, 1, 1, 0, 1, 0, 0, 0}}, |
59 | | {{H2O_STRLIT("date")}, {33, 0, 0, 0, 0, 0, 0, 1}}, |
60 | | {{H2O_STRLIT("early-data")}, {0, 0, 0, 0, 0, 0, 0, 0}}, |
61 | | {{H2O_STRLIT("etag")}, {34, 0, 0, 0, 0, 0, 0, 0}}, |
62 | | {{H2O_STRLIT("expect")}, {35, 0, 0, 1, 1, 0, 0, 1}}, |
63 | | {{H2O_STRLIT("expect-ct")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
64 | | {{H2O_STRLIT("expires")}, {36, 0, 0, 0, 0, 0, 0, 0}}, |
65 | | {{H2O_STRLIT("forwarded")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
66 | | {{H2O_STRLIT("from")}, {37, 0, 0, 0, 0, 0, 0, 1}}, |
67 | | {{H2O_STRLIT("host")}, {38, 0, 0, 1, 1, 0, 0, 0}}, |
68 | | {{H2O_STRLIT("http2-settings")}, {0, 1, 0, 0, 1, 0, 0, 0}}, |
69 | | {{H2O_STRLIT("if-match")}, {39, 0, 0, 0, 0, 0, 0, 0}}, |
70 | | {{H2O_STRLIT("if-modified-since")}, {40, 0, 0, 0, 0, 0, 0, 0}}, |
71 | | {{H2O_STRLIT("if-none-match")}, {41, 0, 0, 0, 0, 0, 0, 0}}, |
72 | | {{H2O_STRLIT("if-range")}, {42, 0, 0, 0, 0, 0, 0, 0}}, |
73 | | {{H2O_STRLIT("if-unmodified-since")}, {43, 0, 0, 0, 0, 0, 0, 0}}, |
74 | | {{H2O_STRLIT("keep-alive")}, {0, 1, 1, 0, 0, 0, 0, 0}}, |
75 | | {{H2O_STRLIT("last-modified")}, {44, 0, 0, 0, 0, 0, 0, 0}}, |
76 | | {{H2O_STRLIT("link")}, {45, 0, 0, 0, 0, 0, 0, 1}}, |
77 | | {{H2O_STRLIT("location")}, {46, 0, 0, 0, 0, 0, 0, 0}}, |
78 | | {{H2O_STRLIT("max-forwards")}, {47, 0, 0, 0, 0, 0, 0, 0}}, |
79 | | {{H2O_STRLIT("no-early-hints")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
80 | | {{H2O_STRLIT("origin")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
81 | | {{H2O_STRLIT("priority")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
82 | | {{H2O_STRLIT("proxy-authenticate")}, {48, 1, 0, 0, 0, 0, 0, 0}}, |
83 | | {{H2O_STRLIT("proxy-authorization")}, {49, 1, 0, 0, 0, 0, 0, 0}}, |
84 | | {{H2O_STRLIT("proxy-connection")}, {0, 1, 1, 0, 0, 0, 0, 0}}, |
85 | | {{H2O_STRLIT("purpose")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
86 | | {{H2O_STRLIT("range")}, {50, 0, 0, 0, 0, 0, 0, 0}}, |
87 | | {{H2O_STRLIT("referer")}, {51, 0, 0, 0, 0, 0, 0, 1}}, |
88 | | {{H2O_STRLIT("refresh")}, {52, 0, 0, 0, 0, 0, 0, 0}}, |
89 | | {{H2O_STRLIT("retry-after")}, {53, 0, 0, 0, 0, 0, 0, 1}}, |
90 | | {{H2O_STRLIT("server")}, {54, 0, 0, 0, 0, 0, 0, 1}}, |
91 | | {{H2O_STRLIT("set-cookie")}, {55, 0, 0, 0, 0, 0, 1, 0}}, |
92 | | {{H2O_STRLIT("strict-transport-security")}, {56, 0, 0, 0, 0, 0, 0, 1}}, |
93 | | {{H2O_STRLIT("te")}, {0, 1, 0, 0, 1, 0, 0, 1}}, |
94 | | {{H2O_STRLIT("timing-allow-origin")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
95 | | {{H2O_STRLIT("transfer-encoding")}, {57, 1, 1, 1, 1, 0, 0, 0}}, |
96 | | {{H2O_STRLIT("upgrade")}, {0, 1, 1, 1, 1, 0, 0, 0}}, |
97 | | {{H2O_STRLIT("upgrade-insecure-requests")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
98 | | {{H2O_STRLIT("user-agent")}, {58, 0, 0, 0, 0, 1, 0, 1}}, |
99 | | {{H2O_STRLIT("vary")}, {59, 0, 0, 0, 0, 0, 0, 1}}, |
100 | | {{H2O_STRLIT("via")}, {60, 0, 0, 0, 0, 0, 0, 0}}, |
101 | | {{H2O_STRLIT("www-authenticate")}, {61, 0, 0, 0, 0, 0, 0, 0}}, |
102 | | {{H2O_STRLIT("x-compress-hint")}, {0, 0, 0, 0, 0, 0, 0, 0}}, |
103 | | {{H2O_STRLIT("x-content-type-options")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
104 | | {{H2O_STRLIT("x-forwarded-for")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
105 | | {{H2O_STRLIT("x-frame-options")}, {0, 0, 0, 0, 0, 0, 0, 1}}, |
106 | | {{H2O_STRLIT("x-reproxy-url")}, {0, 0, 0, 0, 0, 0, 0, 0}}, |
107 | | {{H2O_STRLIT("x-traffic")}, {0, 0, 0, 0, 0, 0, 0, 0}}, |
108 | | {{H2O_STRLIT("x-xss-protection")}, {0, 0, 0, 0, 0, 0, 0, 1}}}; |
109 | | size_t h2o__num_tokens = 85; |
110 | | |
111 | | const h2o_hpack_static_table_entry_t h2o_hpack_static_table[61] = {{H2O_TOKEN_AUTHORITY, {H2O_STRLIT("")}}, |
112 | | {H2O_TOKEN_METHOD, {H2O_STRLIT("GET")}}, |
113 | | {H2O_TOKEN_METHOD, {H2O_STRLIT("POST")}}, |
114 | | {H2O_TOKEN_PATH, {H2O_STRLIT("/")}}, |
115 | | {H2O_TOKEN_PATH, {H2O_STRLIT("/index.html")}}, |
116 | | {H2O_TOKEN_SCHEME, {H2O_STRLIT("http")}}, |
117 | | {H2O_TOKEN_SCHEME, {H2O_STRLIT("https")}}, |
118 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("200")}}, |
119 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("204")}}, |
120 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("206")}}, |
121 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("304")}}, |
122 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("400")}}, |
123 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("404")}}, |
124 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("500")}}, |
125 | | {H2O_TOKEN_ACCEPT_CHARSET, {H2O_STRLIT("")}}, |
126 | | {H2O_TOKEN_ACCEPT_ENCODING, {H2O_STRLIT("gzip, deflate")}}, |
127 | | {H2O_TOKEN_ACCEPT_LANGUAGE, {H2O_STRLIT("")}}, |
128 | | {H2O_TOKEN_ACCEPT_RANGES, {H2O_STRLIT("")}}, |
129 | | {H2O_TOKEN_ACCEPT, {H2O_STRLIT("")}}, |
130 | | {H2O_TOKEN_ACCESS_CONTROL_ALLOW_ORIGIN, {H2O_STRLIT("")}}, |
131 | | {H2O_TOKEN_AGE, {H2O_STRLIT("")}}, |
132 | | {H2O_TOKEN_ALLOW, {H2O_STRLIT("")}}, |
133 | | {H2O_TOKEN_AUTHORIZATION, {H2O_STRLIT("")}}, |
134 | | {H2O_TOKEN_CACHE_CONTROL, {H2O_STRLIT("")}}, |
135 | | {H2O_TOKEN_CONTENT_DISPOSITION, {H2O_STRLIT("")}}, |
136 | | {H2O_TOKEN_CONTENT_ENCODING, {H2O_STRLIT("")}}, |
137 | | {H2O_TOKEN_CONTENT_LANGUAGE, {H2O_STRLIT("")}}, |
138 | | {H2O_TOKEN_CONTENT_LENGTH, {H2O_STRLIT("")}}, |
139 | | {H2O_TOKEN_CONTENT_LOCATION, {H2O_STRLIT("")}}, |
140 | | {H2O_TOKEN_CONTENT_RANGE, {H2O_STRLIT("")}}, |
141 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("")}}, |
142 | | {H2O_TOKEN_COOKIE, {H2O_STRLIT("")}}, |
143 | | {H2O_TOKEN_DATE, {H2O_STRLIT("")}}, |
144 | | {H2O_TOKEN_ETAG, {H2O_STRLIT("")}}, |
145 | | {H2O_TOKEN_EXPECT, {H2O_STRLIT("")}}, |
146 | | {H2O_TOKEN_EXPIRES, {H2O_STRLIT("")}}, |
147 | | {H2O_TOKEN_FROM, {H2O_STRLIT("")}}, |
148 | | {H2O_TOKEN_HOST, {H2O_STRLIT("")}}, |
149 | | {H2O_TOKEN_IF_MATCH, {H2O_STRLIT("")}}, |
150 | | {H2O_TOKEN_IF_MODIFIED_SINCE, {H2O_STRLIT("")}}, |
151 | | {H2O_TOKEN_IF_NONE_MATCH, {H2O_STRLIT("")}}, |
152 | | {H2O_TOKEN_IF_RANGE, {H2O_STRLIT("")}}, |
153 | | {H2O_TOKEN_IF_UNMODIFIED_SINCE, {H2O_STRLIT("")}}, |
154 | | {H2O_TOKEN_LAST_MODIFIED, {H2O_STRLIT("")}}, |
155 | | {H2O_TOKEN_LINK, {H2O_STRLIT("")}}, |
156 | | {H2O_TOKEN_LOCATION, {H2O_STRLIT("")}}, |
157 | | {H2O_TOKEN_MAX_FORWARDS, {H2O_STRLIT("")}}, |
158 | | {H2O_TOKEN_PROXY_AUTHENTICATE, {H2O_STRLIT("")}}, |
159 | | {H2O_TOKEN_PROXY_AUTHORIZATION, {H2O_STRLIT("")}}, |
160 | | {H2O_TOKEN_RANGE, {H2O_STRLIT("")}}, |
161 | | {H2O_TOKEN_REFERER, {H2O_STRLIT("")}}, |
162 | | {H2O_TOKEN_REFRESH, {H2O_STRLIT("")}}, |
163 | | {H2O_TOKEN_RETRY_AFTER, {H2O_STRLIT("")}}, |
164 | | {H2O_TOKEN_SERVER, {H2O_STRLIT("")}}, |
165 | | {H2O_TOKEN_SET_COOKIE, {H2O_STRLIT("")}}, |
166 | | {H2O_TOKEN_STRICT_TRANSPORT_SECURITY, {H2O_STRLIT("")}}, |
167 | | {H2O_TOKEN_TRANSFER_ENCODING, {H2O_STRLIT("")}}, |
168 | | {H2O_TOKEN_USER_AGENT, {H2O_STRLIT("")}}, |
169 | | {H2O_TOKEN_VARY, {H2O_STRLIT("")}}, |
170 | | {H2O_TOKEN_VIA, {H2O_STRLIT("")}}, |
171 | | {H2O_TOKEN_WWW_AUTHENTICATE, {H2O_STRLIT("")}}}; |
172 | | |
173 | | const h2o_qpack_static_table_entry_t h2o_qpack_static_table[99] = { |
174 | | {H2O_TOKEN_AUTHORITY, {H2O_STRLIT("")}}, |
175 | | {H2O_TOKEN_PATH, {H2O_STRLIT("/")}}, |
176 | | {H2O_TOKEN_AGE, {H2O_STRLIT("0")}}, |
177 | | {H2O_TOKEN_CONTENT_DISPOSITION, {H2O_STRLIT("")}}, |
178 | | {H2O_TOKEN_CONTENT_LENGTH, {H2O_STRLIT("0")}}, |
179 | | {H2O_TOKEN_COOKIE, {H2O_STRLIT("")}}, |
180 | | {H2O_TOKEN_DATE, {H2O_STRLIT("")}}, |
181 | | {H2O_TOKEN_ETAG, {H2O_STRLIT("")}}, |
182 | | {H2O_TOKEN_IF_MODIFIED_SINCE, {H2O_STRLIT("")}}, |
183 | | {H2O_TOKEN_IF_NONE_MATCH, {H2O_STRLIT("")}}, |
184 | | {H2O_TOKEN_LAST_MODIFIED, {H2O_STRLIT("")}}, |
185 | | {H2O_TOKEN_LINK, {H2O_STRLIT("")}}, |
186 | | {H2O_TOKEN_LOCATION, {H2O_STRLIT("")}}, |
187 | | {H2O_TOKEN_REFERER, {H2O_STRLIT("")}}, |
188 | | {H2O_TOKEN_SET_COOKIE, {H2O_STRLIT("")}}, |
189 | | {H2O_TOKEN_METHOD, {H2O_STRLIT("CONNECT")}}, |
190 | | {H2O_TOKEN_METHOD, {H2O_STRLIT("DELETE")}}, |
191 | | {H2O_TOKEN_METHOD, {H2O_STRLIT("GET")}}, |
192 | | {H2O_TOKEN_METHOD, {H2O_STRLIT("HEAD")}}, |
193 | | {H2O_TOKEN_METHOD, {H2O_STRLIT("OPTIONS")}}, |
194 | | {H2O_TOKEN_METHOD, {H2O_STRLIT("POST")}}, |
195 | | {H2O_TOKEN_METHOD, {H2O_STRLIT("PUT")}}, |
196 | | {H2O_TOKEN_SCHEME, {H2O_STRLIT("http")}}, |
197 | | {H2O_TOKEN_SCHEME, {H2O_STRLIT("https")}}, |
198 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("103")}}, |
199 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("200")}}, |
200 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("304")}}, |
201 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("404")}}, |
202 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("503")}}, |
203 | | {H2O_TOKEN_ACCEPT, {H2O_STRLIT("*/*")}}, |
204 | | {H2O_TOKEN_ACCEPT, {H2O_STRLIT("application/dns-message")}}, |
205 | | {H2O_TOKEN_ACCEPT_ENCODING, {H2O_STRLIT("gzip, deflate, br")}}, |
206 | | {H2O_TOKEN_ACCEPT_RANGES, {H2O_STRLIT("bytes")}}, |
207 | | {H2O_TOKEN_ACCESS_CONTROL_ALLOW_HEADERS, {H2O_STRLIT("cache-control")}}, |
208 | | {H2O_TOKEN_ACCESS_CONTROL_ALLOW_HEADERS, {H2O_STRLIT("content-type")}}, |
209 | | {H2O_TOKEN_ACCESS_CONTROL_ALLOW_ORIGIN, {H2O_STRLIT("*")}}, |
210 | | {H2O_TOKEN_CACHE_CONTROL, {H2O_STRLIT("max-age=0")}}, |
211 | | {H2O_TOKEN_CACHE_CONTROL, {H2O_STRLIT("max-age=2592000")}}, |
212 | | {H2O_TOKEN_CACHE_CONTROL, {H2O_STRLIT("max-age=604800")}}, |
213 | | {H2O_TOKEN_CACHE_CONTROL, {H2O_STRLIT("no-cache")}}, |
214 | | {H2O_TOKEN_CACHE_CONTROL, {H2O_STRLIT("no-store")}}, |
215 | | {H2O_TOKEN_CACHE_CONTROL, {H2O_STRLIT("public, max-age=31536000")}}, |
216 | | {H2O_TOKEN_CONTENT_ENCODING, {H2O_STRLIT("br")}}, |
217 | | {H2O_TOKEN_CONTENT_ENCODING, {H2O_STRLIT("gzip")}}, |
218 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("application/dns-message")}}, |
219 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("application/javascript")}}, |
220 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("application/json")}}, |
221 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("application/x-www-form-urlencoded")}}, |
222 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("image/gif")}}, |
223 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("image/jpeg")}}, |
224 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("image/png")}}, |
225 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("text/css")}}, |
226 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("text/html; charset=utf-8")}}, |
227 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("text/plain")}}, |
228 | | {H2O_TOKEN_CONTENT_TYPE, {H2O_STRLIT("text/plain;charset=utf-8")}}, |
229 | | {H2O_TOKEN_RANGE, {H2O_STRLIT("bytes=0-")}}, |
230 | | {H2O_TOKEN_STRICT_TRANSPORT_SECURITY, {H2O_STRLIT("max-age=31536000")}}, |
231 | | {H2O_TOKEN_STRICT_TRANSPORT_SECURITY, {H2O_STRLIT("max-age=31536000; includesubdomains")}}, |
232 | | {H2O_TOKEN_STRICT_TRANSPORT_SECURITY, {H2O_STRLIT("max-age=31536000; includesubdomains; preload")}}, |
233 | | {H2O_TOKEN_VARY, {H2O_STRLIT("accept-encoding")}}, |
234 | | {H2O_TOKEN_VARY, {H2O_STRLIT("origin")}}, |
235 | | {H2O_TOKEN_X_CONTENT_TYPE_OPTIONS, {H2O_STRLIT("nosniff")}}, |
236 | | {H2O_TOKEN_X_XSS_PROTECTION, {H2O_STRLIT("1; mode=block")}}, |
237 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("100")}}, |
238 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("204")}}, |
239 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("206")}}, |
240 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("302")}}, |
241 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("400")}}, |
242 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("403")}}, |
243 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("421")}}, |
244 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("425")}}, |
245 | | {H2O_TOKEN_STATUS, {H2O_STRLIT("500")}}, |
246 | | {H2O_TOKEN_ACCEPT_LANGUAGE, {H2O_STRLIT("")}}, |
247 | | {H2O_TOKEN_ACCESS_CONTROL_ALLOW_CREDENTIALS, {H2O_STRLIT("FALSE")}}, |
248 | | {H2O_TOKEN_ACCESS_CONTROL_ALLOW_CREDENTIALS, {H2O_STRLIT("TRUE")}}, |
249 | | {H2O_TOKEN_ACCESS_CONTROL_ALLOW_HEADERS, {H2O_STRLIT("*")}}, |
250 | | {H2O_TOKEN_ACCESS_CONTROL_ALLOW_METHODS, {H2O_STRLIT("get")}}, |
251 | | {H2O_TOKEN_ACCESS_CONTROL_ALLOW_METHODS, {H2O_STRLIT("get, post, options")}}, |
252 | | {H2O_TOKEN_ACCESS_CONTROL_ALLOW_METHODS, {H2O_STRLIT("options")}}, |
253 | | {H2O_TOKEN_ACCESS_CONTROL_EXPOSE_HEADERS, {H2O_STRLIT("content-length")}}, |
254 | | {H2O_TOKEN_ACCESS_CONTROL_REQUEST_HEADERS, {H2O_STRLIT("content-type")}}, |
255 | | {H2O_TOKEN_ACCESS_CONTROL_REQUEST_METHOD, {H2O_STRLIT("get")}}, |
256 | | {H2O_TOKEN_ACCESS_CONTROL_REQUEST_METHOD, {H2O_STRLIT("post")}}, |
257 | | {H2O_TOKEN_ALT_SVC, {H2O_STRLIT("clear")}}, |
258 | | {H2O_TOKEN_AUTHORIZATION, {H2O_STRLIT("")}}, |
259 | | {H2O_TOKEN_CONTENT_SECURITY_POLICY, {H2O_STRLIT("script-src 'none'; object-src 'none'; base-uri 'none'")}}, |
260 | | {H2O_TOKEN_EARLY_DATA, {H2O_STRLIT("1")}}, |
261 | | {H2O_TOKEN_EXPECT_CT, {H2O_STRLIT("")}}, |
262 | | {H2O_TOKEN_FORWARDED, {H2O_STRLIT("")}}, |
263 | | {H2O_TOKEN_IF_RANGE, {H2O_STRLIT("")}}, |
264 | | {H2O_TOKEN_ORIGIN, {H2O_STRLIT("")}}, |
265 | | {H2O_TOKEN_PURPOSE, {H2O_STRLIT("prefetch")}}, |
266 | | {H2O_TOKEN_SERVER, {H2O_STRLIT("")}}, |
267 | | {H2O_TOKEN_TIMING_ALLOW_ORIGIN, {H2O_STRLIT("*")}}, |
268 | | {H2O_TOKEN_UPGRADE_INSECURE_REQUESTS, {H2O_STRLIT("1")}}, |
269 | | {H2O_TOKEN_USER_AGENT, {H2O_STRLIT("")}}, |
270 | | {H2O_TOKEN_X_FORWARDED_FOR, {H2O_STRLIT("")}}, |
271 | | {H2O_TOKEN_X_FRAME_OPTIONS, {H2O_STRLIT("deny")}}, |
272 | | {H2O_TOKEN_X_FRAME_OPTIONS, {H2O_STRLIT("sameorigin")}}}; |
273 | | |
274 | | const h2o_token_t *h2o_lookup_token(const char *name, size_t len) |
275 | 58.9k | { |
276 | 58.9k | switch (len) { |
277 | 2.01k | case 2: |
278 | 2.01k | switch (name[1]) { |
279 | 665 | case 'e': |
280 | 665 | if (memcmp(name, "t", 1) == 0) |
281 | 317 | return H2O_TOKEN_TE; |
282 | 348 | break; |
283 | 2.01k | } |
284 | 1.69k | break; |
285 | 5.22k | case 3: |
286 | 5.22k | switch (name[2]) { |
287 | 2.33k | case 'a': |
288 | 2.33k | if (memcmp(name, "vi", 2) == 0) |
289 | 1.43k | return H2O_TOKEN_VIA; |
290 | 898 | break; |
291 | 1.19k | case 'e': |
292 | 1.19k | if (memcmp(name, "ag", 2) == 0) |
293 | 342 | return H2O_TOKEN_AGE; |
294 | 849 | break; |
295 | 5.22k | } |
296 | 3.44k | break; |
297 | 5.74k | case 4: |
298 | 5.74k | switch (name[3]) { |
299 | 859 | case 'e': |
300 | 859 | if (memcmp(name, "dat", 3) == 0) |
301 | 397 | return H2O_TOKEN_DATE; |
302 | 462 | break; |
303 | 889 | case 'g': |
304 | 889 | if (memcmp(name, "eta", 3) == 0) |
305 | 316 | return H2O_TOKEN_ETAG; |
306 | 573 | break; |
307 | 573 | case 'k': |
308 | 541 | if (memcmp(name, "lin", 3) == 0) |
309 | 123 | return H2O_TOKEN_LINK; |
310 | 418 | break; |
311 | 666 | case 'm': |
312 | 666 | if (memcmp(name, "fro", 3) == 0) |
313 | 218 | return H2O_TOKEN_FROM; |
314 | 448 | break; |
315 | 613 | case 't': |
316 | 613 | if (memcmp(name, "hos", 3) == 0) |
317 | 299 | return H2O_TOKEN_HOST; |
318 | 314 | break; |
319 | 608 | case 'y': |
320 | 608 | if (memcmp(name, "var", 3) == 0) |
321 | 230 | return H2O_TOKEN_VARY; |
322 | 378 | break; |
323 | 5.74k | } |
324 | 4.16k | break; |
325 | 4.16k | case 5: |
326 | 1.69k | switch (name[4]) { |
327 | 561 | case 'e': |
328 | 561 | if (memcmp(name, "rang", 4) == 0) |
329 | 287 | return H2O_TOKEN_RANGE; |
330 | 274 | break; |
331 | 274 | case 'h': |
332 | 210 | if (memcmp(name, ":pat", 4) == 0) |
333 | 3 | return H2O_TOKEN_PATH; |
334 | 207 | break; |
335 | 501 | case 'w': |
336 | 501 | if (memcmp(name, "allo", 4) == 0) |
337 | 223 | return H2O_TOKEN_ALLOW; |
338 | 278 | break; |
339 | 1.69k | } |
340 | 1.18k | break; |
341 | 3.75k | case 6: |
342 | 3.75k | switch (name[5]) { |
343 | 635 | case 'e': |
344 | 635 | if (memcmp(name, "cooki", 5) == 0) |
345 | 254 | return H2O_TOKEN_COOKIE; |
346 | 381 | break; |
347 | 780 | case 'n': |
348 | 780 | if (memcmp(name, "origi", 5) == 0) |
349 | 222 | return H2O_TOKEN_ORIGIN; |
350 | 558 | break; |
351 | 679 | case 'r': |
352 | 679 | if (memcmp(name, "serve", 5) == 0) |
353 | 231 | return H2O_TOKEN_SERVER; |
354 | 448 | break; |
355 | 842 | case 't': |
356 | 842 | if (memcmp(name, "accep", 5) == 0) |
357 | 233 | return H2O_TOKEN_ACCEPT; |
358 | 609 | if (memcmp(name, "expec", 5) == 0) |
359 | 249 | return H2O_TOKEN_EXPECT; |
360 | 360 | break; |
361 | 3.75k | } |
362 | 2.56k | break; |
363 | 4.63k | case 7: |
364 | 4.63k | switch (name[6]) { |
365 | 982 | case 'c': |
366 | 982 | if (memcmp(name, "alt-sv", 6) == 0) |
367 | 268 | return H2O_TOKEN_ALT_SVC; |
368 | 714 | break; |
369 | 714 | case 'd': |
370 | 348 | if (memcmp(name, ":metho", 6) == 0) |
371 | 4 | return H2O_TOKEN_METHOD; |
372 | 344 | break; |
373 | 588 | case 'e': |
374 | 588 | if (memcmp(name, ":schem", 6) == 0) |
375 | 3 | return H2O_TOKEN_SCHEME; |
376 | 585 | if (memcmp(name, "purpos", 6) == 0) |
377 | 229 | return H2O_TOKEN_PURPOSE; |
378 | 356 | if (memcmp(name, "upgrad", 6) == 0) |
379 | 2 | return H2O_TOKEN_UPGRADE; |
380 | 354 | break; |
381 | 468 | case 'h': |
382 | 468 | if (memcmp(name, "refres", 6) == 0) |
383 | 149 | return H2O_TOKEN_REFRESH; |
384 | 319 | break; |
385 | 749 | case 'r': |
386 | 749 | if (memcmp(name, "refere", 6) == 0) |
387 | 290 | return H2O_TOKEN_REFERER; |
388 | 459 | break; |
389 | 590 | case 's': |
390 | 590 | if (memcmp(name, ":statu", 6) == 0) |
391 | 1 | return H2O_TOKEN_STATUS; |
392 | 589 | if (memcmp(name, "expire", 6) == 0) |
393 | 215 | return H2O_TOKEN_EXPIRES; |
394 | 374 | break; |
395 | 4.63k | } |
396 | 3.47k | break; |
397 | 3.47k | case 8: |
398 | 2.76k | switch (name[7]) { |
399 | 576 | case 'e': |
400 | 576 | if (memcmp(name, "if-rang", 7) == 0) |
401 | 249 | return H2O_TOKEN_IF_RANGE; |
402 | 327 | break; |
403 | 591 | case 'h': |
404 | 591 | if (memcmp(name, "if-matc", 7) == 0) |
405 | 216 | return H2O_TOKEN_IF_MATCH; |
406 | 375 | break; |
407 | 379 | case 'n': |
408 | 379 | if (memcmp(name, "locatio", 7) == 0) |
409 | 71 | return H2O_TOKEN_LOCATION; |
410 | 308 | break; |
411 | 719 | case 'y': |
412 | 719 | if (memcmp(name, "priorit", 7) == 0) |
413 | 508 | return H2O_TOKEN_PRIORITY; |
414 | 211 | break; |
415 | 2.76k | } |
416 | 1.72k | break; |
417 | 2.27k | case 9: |
418 | 2.27k | switch (name[8]) { |
419 | 504 | case 'c': |
420 | 504 | if (memcmp(name, "x-traffi", 8) == 0) |
421 | 79 | return H2O_TOKEN_X_TRAFFIC; |
422 | 425 | break; |
423 | 446 | case 'd': |
424 | 446 | if (memcmp(name, "forwarde", 8) == 0) |
425 | 218 | return H2O_TOKEN_FORWARDED; |
426 | 228 | break; |
427 | 228 | case 'l': |
428 | 110 | if (memcmp(name, ":protoco", 8) == 0) |
429 | 8 | return H2O_TOKEN_PROTOCOL; |
430 | 102 | break; |
431 | 576 | case 't': |
432 | 576 | if (memcmp(name, "expect-c", 8) == 0) |
433 | 220 | return H2O_TOKEN_EXPECT_CT; |
434 | 356 | break; |
435 | 2.27k | } |
436 | 1.74k | break; |
437 | 3.95k | case 10: |
438 | 3.95k | switch (name[9]) { |
439 | 492 | case 'a': |
440 | 492 | if (memcmp(name, "early-dat", 9) == 0) |
441 | 80 | return H2O_TOKEN_EARLY_DATA; |
442 | 412 | break; |
443 | 532 | case 'e': |
444 | 532 | if (memcmp(name, "keep-aliv", 9) == 0) |
445 | 70 | return H2O_TOKEN_KEEP_ALIVE; |
446 | 462 | if (memcmp(name, "set-cooki", 9) == 0) |
447 | 76 | return H2O_TOKEN_SET_COOKIE; |
448 | 386 | break; |
449 | 715 | case 'n': |
450 | 715 | if (memcmp(name, "connectio", 9) == 0) |
451 | 465 | return H2O_TOKEN_CONNECTION; |
452 | 250 | break; |
453 | 648 | case 't': |
454 | 648 | if (memcmp(name, "user-agen", 9) == 0) |
455 | 232 | return H2O_TOKEN_USER_AGENT; |
456 | 416 | break; |
457 | 522 | case 'y': |
458 | 522 | if (memcmp(name, ":authorit", 9) == 0) |
459 | 3 | return H2O_TOKEN_AUTHORITY; |
460 | 519 | break; |
461 | 3.95k | } |
462 | 3.02k | break; |
463 | 3.02k | case 11: |
464 | 470 | switch (name[10]) { |
465 | 190 | case 'r': |
466 | 190 | if (memcmp(name, "retry-afte", 10) == 0) |
467 | 71 | return H2O_TOKEN_RETRY_AFTER; |
468 | 119 | break; |
469 | 470 | } |
470 | 399 | break; |
471 | 1.61k | case 12: |
472 | 1.61k | switch (name[11]) { |
473 | 406 | case 'e': |
474 | 406 | if (memcmp(name, "content-typ", 11) == 0) |
475 | 65 | return H2O_TOKEN_CONTENT_TYPE; |
476 | 341 | break; |
477 | 715 | case 's': |
478 | 715 | if (memcmp(name, "max-forward", 11) == 0) |
479 | 406 | return H2O_TOKEN_MAX_FORWARDS; |
480 | 309 | break; |
481 | 309 | case 't': |
482 | 108 | if (memcmp(name, "cache-diges", 11) == 0) |
483 | 2 | return H2O_TOKEN_CACHE_DIGEST; |
484 | 106 | break; |
485 | 1.61k | } |
486 | 1.14k | break; |
487 | 3.52k | case 13: |
488 | 3.52k | switch (name[12]) { |
489 | 351 | case 'd': |
490 | 351 | if (memcmp(name, "last-modifie", 12) == 0) |
491 | 80 | return H2O_TOKEN_LAST_MODIFIED; |
492 | 271 | break; |
493 | 446 | case 'e': |
494 | 446 | if (memcmp(name, "content-rang", 12) == 0) |
495 | 130 | return H2O_TOKEN_CONTENT_RANGE; |
496 | 316 | break; |
497 | 465 | case 'h': |
498 | 465 | if (memcmp(name, "if-none-matc", 12) == 0) |
499 | 217 | return H2O_TOKEN_IF_NONE_MATCH; |
500 | 248 | break; |
501 | 897 | case 'l': |
502 | 897 | if (memcmp(name, "cache-contro", 12) == 0) |
503 | 259 | return H2O_TOKEN_CACHE_CONTROL; |
504 | 638 | if (memcmp(name, "x-reproxy-ur", 12) == 0) |
505 | 164 | return H2O_TOKEN_X_REPROXY_URL; |
506 | 474 | break; |
507 | 474 | case 'n': |
508 | 401 | if (memcmp(name, "authorizatio", 12) == 0) |
509 | 83 | return H2O_TOKEN_AUTHORIZATION; |
510 | 318 | break; |
511 | 374 | case 's': |
512 | 374 | if (memcmp(name, "accept-range", 12) == 0) |
513 | 90 | return H2O_TOKEN_ACCEPT_RANGES; |
514 | 284 | break; |
515 | 3.52k | } |
516 | 2.50k | break; |
517 | 2.50k | case 14: |
518 | 1.50k | switch (name[13]) { |
519 | 90 | case 'h': |
520 | 90 | if (memcmp(name, "content-lengt", 13) == 0) |
521 | 1 | return H2O_TOKEN_CONTENT_LENGTH; |
522 | 89 | break; |
523 | 597 | case 's': |
524 | 597 | if (memcmp(name, "http2-setting", 13) == 0) |
525 | 1 | return H2O_TOKEN_HTTP2_SETTINGS; |
526 | 596 | if (memcmp(name, "no-early-hint", 13) == 0) |
527 | 259 | return H2O_TOKEN_NO_EARLY_HINTS; |
528 | 337 | break; |
529 | 426 | case 't': |
530 | 426 | if (memcmp(name, "accept-charse", 13) == 0) |
531 | 241 | return H2O_TOKEN_ACCEPT_CHARSET; |
532 | 185 | break; |
533 | 1.50k | } |
534 | 1.00k | break; |
535 | 2.20k | case 15: |
536 | 2.20k | switch (name[14]) { |
537 | 422 | case 'e': |
538 | 422 | if (memcmp(name, "accept-languag", 14) == 0) |
539 | 81 | return H2O_TOKEN_ACCEPT_LANGUAGE; |
540 | 341 | break; |
541 | 345 | case 'g': |
542 | 345 | if (memcmp(name, "accept-encodin", 14) == 0) |
543 | 68 | return H2O_TOKEN_ACCEPT_ENCODING; |
544 | 277 | break; |
545 | 277 | case 'r': |
546 | 195 | if (memcmp(name, "x-forwarded-fo", 14) == 0) |
547 | 75 | return H2O_TOKEN_X_FORWARDED_FOR; |
548 | 120 | break; |
549 | 346 | case 's': |
550 | 346 | if (memcmp(name, "x-frame-option", 14) == 0) |
551 | 215 | return H2O_TOKEN_X_FRAME_OPTIONS; |
552 | 131 | break; |
553 | 373 | case 't': |
554 | 373 | if (memcmp(name, "x-compress-hin", 14) == 0) |
555 | 80 | return H2O_TOKEN_X_COMPRESS_HINT; |
556 | 293 | break; |
557 | 2.20k | } |
558 | 1.69k | break; |
559 | 2.27k | case 16: |
560 | 2.27k | switch (name[15]) { |
561 | 383 | case 'd': |
562 | 383 | if (memcmp(name, "datagram-flow-i", 15) == 0) |
563 | 230 | return H2O_TOKEN_DATAGRAM_FLOW_ID; |
564 | 153 | break; |
565 | 462 | case 'e': |
566 | 462 | if (memcmp(name, "content-languag", 15) == 0) |
567 | 79 | return H2O_TOKEN_CONTENT_LANGUAGE; |
568 | 383 | if (memcmp(name, "www-authenticat", 15) == 0) |
569 | 69 | return H2O_TOKEN_WWW_AUTHENTICATE; |
570 | 314 | break; |
571 | 314 | case 'g': |
572 | 201 | if (memcmp(name, "content-encodin", 15) == 0) |
573 | 71 | return H2O_TOKEN_CONTENT_ENCODING; |
574 | 130 | break; |
575 | 810 | case 'n': |
576 | 810 | if (memcmp(name, "content-locatio", 15) == 0) |
577 | 232 | return H2O_TOKEN_CONTENT_LOCATION; |
578 | 578 | if (memcmp(name, "proxy-connectio", 15) == 0) |
579 | 72 | return H2O_TOKEN_PROXY_CONNECTION; |
580 | 506 | if (memcmp(name, "x-xss-protectio", 15) == 0) |
581 | 122 | return H2O_TOKEN_X_XSS_PROTECTION; |
582 | 384 | break; |
583 | 2.27k | } |
584 | 1.40k | break; |
585 | 1.40k | case 17: |
586 | 657 | switch (name[16]) { |
587 | 370 | case 'e': |
588 | 370 | if (memcmp(name, "if-modified-sinc", 16) == 0) |
589 | 71 | return H2O_TOKEN_IF_MODIFIED_SINCE; |
590 | 299 | break; |
591 | 299 | case 'g': |
592 | 119 | if (memcmp(name, "transfer-encodin", 16) == 0) |
593 | 1 | return H2O_TOKEN_TRANSFER_ENCODING; |
594 | 118 | break; |
595 | 657 | } |
596 | 585 | break; |
597 | 585 | case 18: |
598 | 543 | switch (name[17]) { |
599 | 320 | case 'e': |
600 | 320 | if (memcmp(name, "proxy-authenticat", 17) == 0) |
601 | 70 | return H2O_TOKEN_PROXY_AUTHENTICATE; |
602 | 250 | break; |
603 | 543 | } |
604 | 473 | break; |
605 | 923 | case 19: |
606 | 923 | switch (name[18]) { |
607 | 239 | case 'e': |
608 | 239 | if (memcmp(name, "if-unmodified-sinc", 18) == 0) |
609 | 85 | return H2O_TOKEN_IF_UNMODIFIED_SINCE; |
610 | 154 | break; |
611 | 418 | case 'n': |
612 | 418 | if (memcmp(name, "content-dispositio", 18) == 0) |
613 | 78 | return H2O_TOKEN_CONTENT_DISPOSITION; |
614 | 340 | if (memcmp(name, "proxy-authorizatio", 18) == 0) |
615 | 75 | return H2O_TOKEN_PROXY_AUTHORIZATION; |
616 | 265 | if (memcmp(name, "timing-allow-origi", 18) == 0) |
617 | 107 | return H2O_TOKEN_TIMING_ALLOW_ORIGIN; |
618 | 158 | break; |
619 | 923 | } |
620 | 578 | break; |
621 | 578 | case 22: |
622 | 374 | switch (name[21]) { |
623 | 245 | case 's': |
624 | 245 | if (memcmp(name, "x-content-type-option", 21) == 0) |
625 | 99 | return H2O_TOKEN_X_CONTENT_TYPE_OPTIONS; |
626 | 146 | break; |
627 | 374 | } |
628 | 275 | break; |
629 | 408 | case 23: |
630 | 408 | switch (name[22]) { |
631 | 167 | case 'y': |
632 | 167 | if (memcmp(name, "content-security-polic", 22) == 0) |
633 | 74 | return H2O_TOKEN_CONTENT_SECURITY_POLICY; |
634 | 93 | break; |
635 | 408 | } |
636 | 334 | break; |
637 | 500 | case 25: |
638 | 500 | switch (name[24]) { |
639 | 183 | case 's': |
640 | 183 | if (memcmp(name, "upgrade-insecure-request", 24) == 0) |
641 | 75 | return H2O_TOKEN_UPGRADE_INSECURE_REQUESTS; |
642 | 108 | break; |
643 | 205 | case 'y': |
644 | 205 | if (memcmp(name, "strict-transport-securit", 24) == 0) |
645 | 91 | return H2O_TOKEN_STRICT_TRANSPORT_SECURITY; |
646 | 114 | break; |
647 | 500 | } |
648 | 334 | break; |
649 | 418 | case 27: |
650 | 418 | switch (name[26]) { |
651 | 185 | case 'n': |
652 | 185 | if (memcmp(name, "access-control-allow-origi", 26) == 0) |
653 | 75 | return H2O_TOKEN_ACCESS_CONTROL_ALLOW_ORIGIN; |
654 | 110 | break; |
655 | 418 | } |
656 | 343 | break; |
657 | 381 | case 28: |
658 | 381 | switch (name[27]) { |
659 | 257 | case 's': |
660 | 257 | if (memcmp(name, "access-control-allow-header", 27) == 0) |
661 | 69 | return H2O_TOKEN_ACCESS_CONTROL_ALLOW_HEADERS; |
662 | 188 | if (memcmp(name, "access-control-allow-method", 27) == 0) |
663 | 71 | return H2O_TOKEN_ACCESS_CONTROL_ALLOW_METHODS; |
664 | 117 | break; |
665 | 381 | } |
666 | 241 | break; |
667 | 779 | case 29: |
668 | 779 | switch (name[28]) { |
669 | 320 | case 'd': |
670 | 320 | if (memcmp(name, "access-control-request-metho", 28) == 0) |
671 | 66 | return H2O_TOKEN_ACCESS_CONTROL_REQUEST_METHOD; |
672 | 254 | break; |
673 | 254 | case 's': |
674 | 169 | if (memcmp(name, "access-control-expose-header", 28) == 0) |
675 | 69 | return H2O_TOKEN_ACCESS_CONTROL_EXPOSE_HEADERS; |
676 | 100 | break; |
677 | 779 | } |
678 | 644 | break; |
679 | 644 | case 30: |
680 | 349 | switch (name[29]) { |
681 | 174 | case 's': |
682 | 174 | if (memcmp(name, "access-control-request-header", 29) == 0) |
683 | 67 | return H2O_TOKEN_ACCESS_CONTROL_REQUEST_HEADERS; |
684 | 107 | break; |
685 | 349 | } |
686 | 282 | break; |
687 | 392 | case 32: |
688 | 392 | switch (name[31]) { |
689 | 291 | case 's': |
690 | 291 | if (memcmp(name, "access-control-allow-credential", 31) == 0) |
691 | 70 | return H2O_TOKEN_ACCESS_CONTROL_ALLOW_CREDENTIALS; |
692 | 221 | break; |
693 | 392 | } |
694 | 322 | break; |
695 | 58.9k | } |
696 | | |
697 | 45.1k | return NULL; |
698 | 58.9k | } |
699 | | |
700 | | int32_t h2o_qpack_lookup_authority(h2o_iovec_t value, int *is_exact) |
701 | 0 | { |
702 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
703 | 0 | *is_exact = 1; |
704 | 0 | return 0; |
705 | 0 | } |
706 | 0 | *is_exact = 0; |
707 | 0 | return 0; |
708 | 0 | } |
709 | | |
710 | | int32_t h2o_qpack_lookup_method(h2o_iovec_t value, int *is_exact) |
711 | 0 | { |
712 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("CONNECT"))) { |
713 | 0 | *is_exact = 1; |
714 | 0 | return 15; |
715 | 0 | } |
716 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("DELETE"))) { |
717 | 0 | *is_exact = 1; |
718 | 0 | return 16; |
719 | 0 | } |
720 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("GET"))) { |
721 | 0 | *is_exact = 1; |
722 | 0 | return 17; |
723 | 0 | } |
724 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("HEAD"))) { |
725 | 0 | *is_exact = 1; |
726 | 0 | return 18; |
727 | 0 | } |
728 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("OPTIONS"))) { |
729 | 0 | *is_exact = 1; |
730 | 0 | return 19; |
731 | 0 | } |
732 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("POST"))) { |
733 | 0 | *is_exact = 1; |
734 | 0 | return 20; |
735 | 0 | } |
736 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("PUT"))) { |
737 | 0 | *is_exact = 1; |
738 | 0 | return 21; |
739 | 0 | } |
740 | 0 | *is_exact = 0; |
741 | 0 | return 15; |
742 | 0 | } |
743 | | |
744 | | int32_t h2o_qpack_lookup_path(h2o_iovec_t value, int *is_exact) |
745 | 0 | { |
746 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("/"))) { |
747 | 0 | *is_exact = 1; |
748 | 0 | return 1; |
749 | 0 | } |
750 | 0 | *is_exact = 0; |
751 | 0 | return 1; |
752 | 0 | } |
753 | | |
754 | | int32_t h2o_qpack_lookup_protocol(h2o_iovec_t value, int *is_exact) |
755 | 0 | { |
756 | 0 | *is_exact = 0; |
757 | 0 | return -1; |
758 | 0 | } |
759 | | |
760 | | int32_t h2o_qpack_lookup_scheme(h2o_iovec_t value, int *is_exact) |
761 | 0 | { |
762 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("http"))) { |
763 | 0 | *is_exact = 1; |
764 | 0 | return 22; |
765 | 0 | } |
766 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("https"))) { |
767 | 0 | *is_exact = 1; |
768 | 0 | return 23; |
769 | 0 | } |
770 | 0 | *is_exact = 0; |
771 | 0 | return 22; |
772 | 0 | } |
773 | | |
774 | | int32_t h2o_qpack_lookup_status(h2o_iovec_t value, int *is_exact) |
775 | 0 | { |
776 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("103"))) { |
777 | 0 | *is_exact = 1; |
778 | 0 | return 24; |
779 | 0 | } |
780 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("200"))) { |
781 | 0 | *is_exact = 1; |
782 | 0 | return 25; |
783 | 0 | } |
784 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("304"))) { |
785 | 0 | *is_exact = 1; |
786 | 0 | return 26; |
787 | 0 | } |
788 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("404"))) { |
789 | 0 | *is_exact = 1; |
790 | 0 | return 27; |
791 | 0 | } |
792 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("503"))) { |
793 | 0 | *is_exact = 1; |
794 | 0 | return 28; |
795 | 0 | } |
796 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("100"))) { |
797 | 0 | *is_exact = 1; |
798 | 0 | return 63; |
799 | 0 | } |
800 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("204"))) { |
801 | 0 | *is_exact = 1; |
802 | 0 | return 64; |
803 | 0 | } |
804 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("206"))) { |
805 | 0 | *is_exact = 1; |
806 | 0 | return 65; |
807 | 0 | } |
808 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("302"))) { |
809 | 0 | *is_exact = 1; |
810 | 0 | return 66; |
811 | 0 | } |
812 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("400"))) { |
813 | 0 | *is_exact = 1; |
814 | 0 | return 67; |
815 | 0 | } |
816 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("403"))) { |
817 | 0 | *is_exact = 1; |
818 | 0 | return 68; |
819 | 0 | } |
820 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("421"))) { |
821 | 0 | *is_exact = 1; |
822 | 0 | return 69; |
823 | 0 | } |
824 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("425"))) { |
825 | 0 | *is_exact = 1; |
826 | 0 | return 70; |
827 | 0 | } |
828 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("500"))) { |
829 | 0 | *is_exact = 1; |
830 | 0 | return 71; |
831 | 0 | } |
832 | 0 | *is_exact = 0; |
833 | 0 | return 24; |
834 | 0 | } |
835 | | |
836 | | int32_t h2o_qpack_lookup_accept(h2o_iovec_t value, int *is_exact) |
837 | 0 | { |
838 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("*/*"))) { |
839 | 0 | *is_exact = 1; |
840 | 0 | return 29; |
841 | 0 | } |
842 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("application/dns-message"))) { |
843 | 0 | *is_exact = 1; |
844 | 0 | return 30; |
845 | 0 | } |
846 | 0 | *is_exact = 0; |
847 | 0 | return 29; |
848 | 0 | } |
849 | | |
850 | | int32_t h2o_qpack_lookup_accept_charset(h2o_iovec_t value, int *is_exact) |
851 | 0 | { |
852 | 0 | *is_exact = 0; |
853 | 0 | return -1; |
854 | 0 | } |
855 | | |
856 | | int32_t h2o_qpack_lookup_accept_encoding(h2o_iovec_t value, int *is_exact) |
857 | 0 | { |
858 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("gzip, deflate, br"))) { |
859 | 0 | *is_exact = 1; |
860 | 0 | return 31; |
861 | 0 | } |
862 | 0 | *is_exact = 0; |
863 | 0 | return 31; |
864 | 0 | } |
865 | | |
866 | | int32_t h2o_qpack_lookup_accept_language(h2o_iovec_t value, int *is_exact) |
867 | 0 | { |
868 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
869 | 0 | *is_exact = 1; |
870 | 0 | return 72; |
871 | 0 | } |
872 | 0 | *is_exact = 0; |
873 | 0 | return 72; |
874 | 0 | } |
875 | | |
876 | | int32_t h2o_qpack_lookup_accept_ranges(h2o_iovec_t value, int *is_exact) |
877 | 0 | { |
878 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("bytes"))) { |
879 | 0 | *is_exact = 1; |
880 | 0 | return 32; |
881 | 0 | } |
882 | 0 | *is_exact = 0; |
883 | 0 | return 32; |
884 | 0 | } |
885 | | |
886 | | int32_t h2o_qpack_lookup_access_control_allow_credentials(h2o_iovec_t value, int *is_exact) |
887 | 0 | { |
888 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("FALSE"))) { |
889 | 0 | *is_exact = 1; |
890 | 0 | return 73; |
891 | 0 | } |
892 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("TRUE"))) { |
893 | 0 | *is_exact = 1; |
894 | 0 | return 74; |
895 | 0 | } |
896 | 0 | *is_exact = 0; |
897 | 0 | return 73; |
898 | 0 | } |
899 | | |
900 | | int32_t h2o_qpack_lookup_access_control_allow_headers(h2o_iovec_t value, int *is_exact) |
901 | 0 | { |
902 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("cache-control"))) { |
903 | 0 | *is_exact = 1; |
904 | 0 | return 33; |
905 | 0 | } |
906 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("content-type"))) { |
907 | 0 | *is_exact = 1; |
908 | 0 | return 34; |
909 | 0 | } |
910 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("*"))) { |
911 | 0 | *is_exact = 1; |
912 | 0 | return 75; |
913 | 0 | } |
914 | 0 | *is_exact = 0; |
915 | 0 | return 33; |
916 | 0 | } |
917 | | |
918 | | int32_t h2o_qpack_lookup_access_control_allow_methods(h2o_iovec_t value, int *is_exact) |
919 | 0 | { |
920 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("get"))) { |
921 | 0 | *is_exact = 1; |
922 | 0 | return 76; |
923 | 0 | } |
924 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("get, post, options"))) { |
925 | 0 | *is_exact = 1; |
926 | 0 | return 77; |
927 | 0 | } |
928 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("options"))) { |
929 | 0 | *is_exact = 1; |
930 | 0 | return 78; |
931 | 0 | } |
932 | 0 | *is_exact = 0; |
933 | 0 | return 76; |
934 | 0 | } |
935 | | |
936 | | int32_t h2o_qpack_lookup_access_control_allow_origin(h2o_iovec_t value, int *is_exact) |
937 | 0 | { |
938 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("*"))) { |
939 | 0 | *is_exact = 1; |
940 | 0 | return 35; |
941 | 0 | } |
942 | 0 | *is_exact = 0; |
943 | 0 | return 35; |
944 | 0 | } |
945 | | |
946 | | int32_t h2o_qpack_lookup_access_control_expose_headers(h2o_iovec_t value, int *is_exact) |
947 | 0 | { |
948 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("content-length"))) { |
949 | 0 | *is_exact = 1; |
950 | 0 | return 79; |
951 | 0 | } |
952 | 0 | *is_exact = 0; |
953 | 0 | return 79; |
954 | 0 | } |
955 | | |
956 | | int32_t h2o_qpack_lookup_access_control_request_headers(h2o_iovec_t value, int *is_exact) |
957 | 0 | { |
958 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("content-type"))) { |
959 | 0 | *is_exact = 1; |
960 | 0 | return 80; |
961 | 0 | } |
962 | 0 | *is_exact = 0; |
963 | 0 | return 80; |
964 | 0 | } |
965 | | |
966 | | int32_t h2o_qpack_lookup_access_control_request_method(h2o_iovec_t value, int *is_exact) |
967 | 0 | { |
968 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("get"))) { |
969 | 0 | *is_exact = 1; |
970 | 0 | return 81; |
971 | 0 | } |
972 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("post"))) { |
973 | 0 | *is_exact = 1; |
974 | 0 | return 82; |
975 | 0 | } |
976 | 0 | *is_exact = 0; |
977 | 0 | return 81; |
978 | 0 | } |
979 | | |
980 | | int32_t h2o_qpack_lookup_age(h2o_iovec_t value, int *is_exact) |
981 | 0 | { |
982 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("0"))) { |
983 | 0 | *is_exact = 1; |
984 | 0 | return 2; |
985 | 0 | } |
986 | 0 | *is_exact = 0; |
987 | 0 | return 2; |
988 | 0 | } |
989 | | |
990 | | int32_t h2o_qpack_lookup_allow(h2o_iovec_t value, int *is_exact) |
991 | 0 | { |
992 | 0 | *is_exact = 0; |
993 | 0 | return -1; |
994 | 0 | } |
995 | | |
996 | | int32_t h2o_qpack_lookup_alt_svc(h2o_iovec_t value, int *is_exact) |
997 | 0 | { |
998 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("clear"))) { |
999 | 0 | *is_exact = 1; |
1000 | 0 | return 83; |
1001 | 0 | } |
1002 | 0 | *is_exact = 0; |
1003 | 0 | return 83; |
1004 | 0 | } |
1005 | | |
1006 | | int32_t h2o_qpack_lookup_authorization(h2o_iovec_t value, int *is_exact) |
1007 | 0 | { |
1008 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1009 | 0 | *is_exact = 1; |
1010 | 0 | return 84; |
1011 | 0 | } |
1012 | 0 | *is_exact = 0; |
1013 | 0 | return 84; |
1014 | 0 | } |
1015 | | |
1016 | | int32_t h2o_qpack_lookup_cache_control(h2o_iovec_t value, int *is_exact) |
1017 | 0 | { |
1018 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("max-age=0"))) { |
1019 | 0 | *is_exact = 1; |
1020 | 0 | return 36; |
1021 | 0 | } |
1022 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("max-age=2592000"))) { |
1023 | 0 | *is_exact = 1; |
1024 | 0 | return 37; |
1025 | 0 | } |
1026 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("max-age=604800"))) { |
1027 | 0 | *is_exact = 1; |
1028 | 0 | return 38; |
1029 | 0 | } |
1030 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("no-cache"))) { |
1031 | 0 | *is_exact = 1; |
1032 | 0 | return 39; |
1033 | 0 | } |
1034 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("no-store"))) { |
1035 | 0 | *is_exact = 1; |
1036 | 0 | return 40; |
1037 | 0 | } |
1038 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("public, max-age=31536000"))) { |
1039 | 0 | *is_exact = 1; |
1040 | 0 | return 41; |
1041 | 0 | } |
1042 | 0 | *is_exact = 0; |
1043 | 0 | return 36; |
1044 | 0 | } |
1045 | | |
1046 | | int32_t h2o_qpack_lookup_cache_digest(h2o_iovec_t value, int *is_exact) |
1047 | 0 | { |
1048 | 0 | *is_exact = 0; |
1049 | 0 | return -1; |
1050 | 0 | } |
1051 | | |
1052 | | int32_t h2o_qpack_lookup_connection(h2o_iovec_t value, int *is_exact) |
1053 | 0 | { |
1054 | 0 | *is_exact = 0; |
1055 | 0 | return -1; |
1056 | 0 | } |
1057 | | |
1058 | | int32_t h2o_qpack_lookup_content_disposition(h2o_iovec_t value, int *is_exact) |
1059 | 0 | { |
1060 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1061 | 0 | *is_exact = 1; |
1062 | 0 | return 3; |
1063 | 0 | } |
1064 | 0 | *is_exact = 0; |
1065 | 0 | return 3; |
1066 | 0 | } |
1067 | | |
1068 | | int32_t h2o_qpack_lookup_content_encoding(h2o_iovec_t value, int *is_exact) |
1069 | 0 | { |
1070 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("br"))) { |
1071 | 0 | *is_exact = 1; |
1072 | 0 | return 42; |
1073 | 0 | } |
1074 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("gzip"))) { |
1075 | 0 | *is_exact = 1; |
1076 | 0 | return 43; |
1077 | 0 | } |
1078 | 0 | *is_exact = 0; |
1079 | 0 | return 42; |
1080 | 0 | } |
1081 | | |
1082 | | int32_t h2o_qpack_lookup_content_language(h2o_iovec_t value, int *is_exact) |
1083 | 0 | { |
1084 | 0 | *is_exact = 0; |
1085 | 0 | return -1; |
1086 | 0 | } |
1087 | | |
1088 | | int32_t h2o_qpack_lookup_content_length(h2o_iovec_t value, int *is_exact) |
1089 | 0 | { |
1090 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("0"))) { |
1091 | 0 | *is_exact = 1; |
1092 | 0 | return 4; |
1093 | 0 | } |
1094 | 0 | *is_exact = 0; |
1095 | 0 | return 4; |
1096 | 0 | } |
1097 | | |
1098 | | int32_t h2o_qpack_lookup_content_location(h2o_iovec_t value, int *is_exact) |
1099 | 0 | { |
1100 | 0 | *is_exact = 0; |
1101 | 0 | return -1; |
1102 | 0 | } |
1103 | | |
1104 | | int32_t h2o_qpack_lookup_content_range(h2o_iovec_t value, int *is_exact) |
1105 | 0 | { |
1106 | 0 | *is_exact = 0; |
1107 | 0 | return -1; |
1108 | 0 | } |
1109 | | |
1110 | | int32_t h2o_qpack_lookup_content_security_policy(h2o_iovec_t value, int *is_exact) |
1111 | 0 | { |
1112 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("script-src 'none'; object-src 'none'; base-uri 'none'"))) { |
1113 | 0 | *is_exact = 1; |
1114 | 0 | return 85; |
1115 | 0 | } |
1116 | 0 | *is_exact = 0; |
1117 | 0 | return 85; |
1118 | 0 | } |
1119 | | |
1120 | | int32_t h2o_qpack_lookup_content_type(h2o_iovec_t value, int *is_exact) |
1121 | 1.05k | { |
1122 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("application/dns-message"))) { |
1123 | 0 | *is_exact = 1; |
1124 | 0 | return 44; |
1125 | 0 | } |
1126 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("application/javascript"))) { |
1127 | 0 | *is_exact = 1; |
1128 | 0 | return 45; |
1129 | 0 | } |
1130 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("application/json"))) { |
1131 | 0 | *is_exact = 1; |
1132 | 0 | return 46; |
1133 | 0 | } |
1134 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("application/x-www-form-urlencoded"))) { |
1135 | 0 | *is_exact = 1; |
1136 | 0 | return 47; |
1137 | 0 | } |
1138 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("image/gif"))) { |
1139 | 0 | *is_exact = 1; |
1140 | 0 | return 48; |
1141 | 0 | } |
1142 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("image/jpeg"))) { |
1143 | 0 | *is_exact = 1; |
1144 | 0 | return 49; |
1145 | 0 | } |
1146 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("image/png"))) { |
1147 | 0 | *is_exact = 1; |
1148 | 0 | return 50; |
1149 | 0 | } |
1150 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("text/css"))) { |
1151 | 0 | *is_exact = 1; |
1152 | 0 | return 51; |
1153 | 0 | } |
1154 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("text/html; charset=utf-8"))) { |
1155 | 0 | *is_exact = 1; |
1156 | 0 | return 52; |
1157 | 0 | } |
1158 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("text/plain"))) { |
1159 | 0 | *is_exact = 1; |
1160 | 0 | return 53; |
1161 | 0 | } |
1162 | 1.05k | if (h2o_memis(value.base, value.len, H2O_STRLIT("text/plain;charset=utf-8"))) { |
1163 | 0 | *is_exact = 1; |
1164 | 0 | return 54; |
1165 | 0 | } |
1166 | 1.05k | *is_exact = 0; |
1167 | 1.05k | return 44; |
1168 | 1.05k | } |
1169 | | |
1170 | | int32_t h2o_qpack_lookup_cookie(h2o_iovec_t value, int *is_exact) |
1171 | 0 | { |
1172 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1173 | 0 | *is_exact = 1; |
1174 | 0 | return 5; |
1175 | 0 | } |
1176 | 0 | *is_exact = 0; |
1177 | 0 | return 5; |
1178 | 0 | } |
1179 | | |
1180 | | int32_t h2o_qpack_lookup_datagram_flow_id(h2o_iovec_t value, int *is_exact) |
1181 | 0 | { |
1182 | 0 | *is_exact = 0; |
1183 | 0 | return -1; |
1184 | 0 | } |
1185 | | |
1186 | | int32_t h2o_qpack_lookup_date(h2o_iovec_t value, int *is_exact) |
1187 | 465 | { |
1188 | 465 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1189 | 0 | *is_exact = 1; |
1190 | 0 | return 6; |
1191 | 0 | } |
1192 | 465 | *is_exact = 0; |
1193 | 465 | return 6; |
1194 | 465 | } |
1195 | | |
1196 | | int32_t h2o_qpack_lookup_early_data(h2o_iovec_t value, int *is_exact) |
1197 | 0 | { |
1198 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("1"))) { |
1199 | 0 | *is_exact = 1; |
1200 | 0 | return 86; |
1201 | 0 | } |
1202 | 0 | *is_exact = 0; |
1203 | 0 | return 86; |
1204 | 0 | } |
1205 | | |
1206 | | int32_t h2o_qpack_lookup_etag(h2o_iovec_t value, int *is_exact) |
1207 | 0 | { |
1208 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1209 | 0 | *is_exact = 1; |
1210 | 0 | return 7; |
1211 | 0 | } |
1212 | 0 | *is_exact = 0; |
1213 | 0 | return 7; |
1214 | 0 | } |
1215 | | |
1216 | | int32_t h2o_qpack_lookup_expect(h2o_iovec_t value, int *is_exact) |
1217 | 0 | { |
1218 | 0 | *is_exact = 0; |
1219 | 0 | return -1; |
1220 | 0 | } |
1221 | | |
1222 | | int32_t h2o_qpack_lookup_expect_ct(h2o_iovec_t value, int *is_exact) |
1223 | 0 | { |
1224 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1225 | 0 | *is_exact = 1; |
1226 | 0 | return 87; |
1227 | 0 | } |
1228 | 0 | *is_exact = 0; |
1229 | 0 | return 87; |
1230 | 0 | } |
1231 | | |
1232 | | int32_t h2o_qpack_lookup_expires(h2o_iovec_t value, int *is_exact) |
1233 | 0 | { |
1234 | 0 | *is_exact = 0; |
1235 | 0 | return -1; |
1236 | 0 | } |
1237 | | |
1238 | | int32_t h2o_qpack_lookup_forwarded(h2o_iovec_t value, int *is_exact) |
1239 | 0 | { |
1240 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1241 | 0 | *is_exact = 1; |
1242 | 0 | return 88; |
1243 | 0 | } |
1244 | 0 | *is_exact = 0; |
1245 | 0 | return 88; |
1246 | 0 | } |
1247 | | |
1248 | | int32_t h2o_qpack_lookup_from(h2o_iovec_t value, int *is_exact) |
1249 | 0 | { |
1250 | 0 | *is_exact = 0; |
1251 | 0 | return -1; |
1252 | 0 | } |
1253 | | |
1254 | | int32_t h2o_qpack_lookup_host(h2o_iovec_t value, int *is_exact) |
1255 | 0 | { |
1256 | 0 | *is_exact = 0; |
1257 | 0 | return -1; |
1258 | 0 | } |
1259 | | |
1260 | | int32_t h2o_qpack_lookup_http2_settings(h2o_iovec_t value, int *is_exact) |
1261 | 0 | { |
1262 | 0 | *is_exact = 0; |
1263 | 0 | return -1; |
1264 | 0 | } |
1265 | | |
1266 | | int32_t h2o_qpack_lookup_if_match(h2o_iovec_t value, int *is_exact) |
1267 | 0 | { |
1268 | 0 | *is_exact = 0; |
1269 | 0 | return -1; |
1270 | 0 | } |
1271 | | |
1272 | | int32_t h2o_qpack_lookup_if_modified_since(h2o_iovec_t value, int *is_exact) |
1273 | 0 | { |
1274 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1275 | 0 | *is_exact = 1; |
1276 | 0 | return 8; |
1277 | 0 | } |
1278 | 0 | *is_exact = 0; |
1279 | 0 | return 8; |
1280 | 0 | } |
1281 | | |
1282 | | int32_t h2o_qpack_lookup_if_none_match(h2o_iovec_t value, int *is_exact) |
1283 | 0 | { |
1284 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1285 | 0 | *is_exact = 1; |
1286 | 0 | return 9; |
1287 | 0 | } |
1288 | 0 | *is_exact = 0; |
1289 | 0 | return 9; |
1290 | 0 | } |
1291 | | |
1292 | | int32_t h2o_qpack_lookup_if_range(h2o_iovec_t value, int *is_exact) |
1293 | 0 | { |
1294 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1295 | 0 | *is_exact = 1; |
1296 | 0 | return 89; |
1297 | 0 | } |
1298 | 0 | *is_exact = 0; |
1299 | 0 | return 89; |
1300 | 0 | } |
1301 | | |
1302 | | int32_t h2o_qpack_lookup_if_unmodified_since(h2o_iovec_t value, int *is_exact) |
1303 | 0 | { |
1304 | 0 | *is_exact = 0; |
1305 | 0 | return -1; |
1306 | 0 | } |
1307 | | |
1308 | | int32_t h2o_qpack_lookup_keep_alive(h2o_iovec_t value, int *is_exact) |
1309 | 0 | { |
1310 | 0 | *is_exact = 0; |
1311 | 0 | return -1; |
1312 | 0 | } |
1313 | | |
1314 | | int32_t h2o_qpack_lookup_last_modified(h2o_iovec_t value, int *is_exact) |
1315 | 0 | { |
1316 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1317 | 0 | *is_exact = 1; |
1318 | 0 | return 10; |
1319 | 0 | } |
1320 | 0 | *is_exact = 0; |
1321 | 0 | return 10; |
1322 | 0 | } |
1323 | | |
1324 | | int32_t h2o_qpack_lookup_link(h2o_iovec_t value, int *is_exact) |
1325 | 0 | { |
1326 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1327 | 0 | *is_exact = 1; |
1328 | 0 | return 11; |
1329 | 0 | } |
1330 | 0 | *is_exact = 0; |
1331 | 0 | return 11; |
1332 | 0 | } |
1333 | | |
1334 | | int32_t h2o_qpack_lookup_location(h2o_iovec_t value, int *is_exact) |
1335 | 0 | { |
1336 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1337 | 0 | *is_exact = 1; |
1338 | 0 | return 12; |
1339 | 0 | } |
1340 | 0 | *is_exact = 0; |
1341 | 0 | return 12; |
1342 | 0 | } |
1343 | | |
1344 | | int32_t h2o_qpack_lookup_max_forwards(h2o_iovec_t value, int *is_exact) |
1345 | 0 | { |
1346 | 0 | *is_exact = 0; |
1347 | 0 | return -1; |
1348 | 0 | } |
1349 | | |
1350 | | int32_t h2o_qpack_lookup_no_early_hints(h2o_iovec_t value, int *is_exact) |
1351 | 0 | { |
1352 | 0 | *is_exact = 0; |
1353 | 0 | return -1; |
1354 | 0 | } |
1355 | | |
1356 | | int32_t h2o_qpack_lookup_origin(h2o_iovec_t value, int *is_exact) |
1357 | 0 | { |
1358 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1359 | 0 | *is_exact = 1; |
1360 | 0 | return 90; |
1361 | 0 | } |
1362 | 0 | *is_exact = 0; |
1363 | 0 | return 90; |
1364 | 0 | } |
1365 | | |
1366 | | int32_t h2o_qpack_lookup_priority(h2o_iovec_t value, int *is_exact) |
1367 | 0 | { |
1368 | 0 | *is_exact = 0; |
1369 | 0 | return -1; |
1370 | 0 | } |
1371 | | |
1372 | | int32_t h2o_qpack_lookup_proxy_authenticate(h2o_iovec_t value, int *is_exact) |
1373 | 0 | { |
1374 | 0 | *is_exact = 0; |
1375 | 0 | return -1; |
1376 | 0 | } |
1377 | | |
1378 | | int32_t h2o_qpack_lookup_proxy_authorization(h2o_iovec_t value, int *is_exact) |
1379 | 0 | { |
1380 | 0 | *is_exact = 0; |
1381 | 0 | return -1; |
1382 | 0 | } |
1383 | | |
1384 | | int32_t h2o_qpack_lookup_proxy_connection(h2o_iovec_t value, int *is_exact) |
1385 | 0 | { |
1386 | 0 | *is_exact = 0; |
1387 | 0 | return -1; |
1388 | 0 | } |
1389 | | |
1390 | | int32_t h2o_qpack_lookup_purpose(h2o_iovec_t value, int *is_exact) |
1391 | 0 | { |
1392 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("prefetch"))) { |
1393 | 0 | *is_exact = 1; |
1394 | 0 | return 91; |
1395 | 0 | } |
1396 | 0 | *is_exact = 0; |
1397 | 0 | return 91; |
1398 | 0 | } |
1399 | | |
1400 | | int32_t h2o_qpack_lookup_range(h2o_iovec_t value, int *is_exact) |
1401 | 0 | { |
1402 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("bytes=0-"))) { |
1403 | 0 | *is_exact = 1; |
1404 | 0 | return 55; |
1405 | 0 | } |
1406 | 0 | *is_exact = 0; |
1407 | 0 | return 55; |
1408 | 0 | } |
1409 | | |
1410 | | int32_t h2o_qpack_lookup_referer(h2o_iovec_t value, int *is_exact) |
1411 | 0 | { |
1412 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1413 | 0 | *is_exact = 1; |
1414 | 0 | return 13; |
1415 | 0 | } |
1416 | 0 | *is_exact = 0; |
1417 | 0 | return 13; |
1418 | 0 | } |
1419 | | |
1420 | | int32_t h2o_qpack_lookup_refresh(h2o_iovec_t value, int *is_exact) |
1421 | 0 | { |
1422 | 0 | *is_exact = 0; |
1423 | 0 | return -1; |
1424 | 0 | } |
1425 | | |
1426 | | int32_t h2o_qpack_lookup_retry_after(h2o_iovec_t value, int *is_exact) |
1427 | 0 | { |
1428 | 0 | *is_exact = 0; |
1429 | 0 | return -1; |
1430 | 0 | } |
1431 | | |
1432 | | int32_t h2o_qpack_lookup_server(h2o_iovec_t value, int *is_exact) |
1433 | 0 | { |
1434 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1435 | 0 | *is_exact = 1; |
1436 | 0 | return 92; |
1437 | 0 | } |
1438 | 0 | *is_exact = 0; |
1439 | 0 | return 92; |
1440 | 0 | } |
1441 | | |
1442 | | int32_t h2o_qpack_lookup_set_cookie(h2o_iovec_t value, int *is_exact) |
1443 | 0 | { |
1444 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1445 | 0 | *is_exact = 1; |
1446 | 0 | return 14; |
1447 | 0 | } |
1448 | 0 | *is_exact = 0; |
1449 | 0 | return 14; |
1450 | 0 | } |
1451 | | |
1452 | | int32_t h2o_qpack_lookup_strict_transport_security(h2o_iovec_t value, int *is_exact) |
1453 | 0 | { |
1454 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("max-age=31536000"))) { |
1455 | 0 | *is_exact = 1; |
1456 | 0 | return 56; |
1457 | 0 | } |
1458 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("max-age=31536000; includesubdomains"))) { |
1459 | 0 | *is_exact = 1; |
1460 | 0 | return 57; |
1461 | 0 | } |
1462 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("max-age=31536000; includesubdomains; preload"))) { |
1463 | 0 | *is_exact = 1; |
1464 | 0 | return 58; |
1465 | 0 | } |
1466 | 0 | *is_exact = 0; |
1467 | 0 | return 56; |
1468 | 0 | } |
1469 | | |
1470 | | int32_t h2o_qpack_lookup_te(h2o_iovec_t value, int *is_exact) |
1471 | 0 | { |
1472 | 0 | *is_exact = 0; |
1473 | 0 | return -1; |
1474 | 0 | } |
1475 | | |
1476 | | int32_t h2o_qpack_lookup_timing_allow_origin(h2o_iovec_t value, int *is_exact) |
1477 | 0 | { |
1478 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("*"))) { |
1479 | 0 | *is_exact = 1; |
1480 | 0 | return 93; |
1481 | 0 | } |
1482 | 0 | *is_exact = 0; |
1483 | 0 | return 93; |
1484 | 0 | } |
1485 | | |
1486 | | int32_t h2o_qpack_lookup_transfer_encoding(h2o_iovec_t value, int *is_exact) |
1487 | 0 | { |
1488 | 0 | *is_exact = 0; |
1489 | 0 | return -1; |
1490 | 0 | } |
1491 | | |
1492 | | int32_t h2o_qpack_lookup_upgrade(h2o_iovec_t value, int *is_exact) |
1493 | 0 | { |
1494 | 0 | *is_exact = 0; |
1495 | 0 | return -1; |
1496 | 0 | } |
1497 | | |
1498 | | int32_t h2o_qpack_lookup_upgrade_insecure_requests(h2o_iovec_t value, int *is_exact) |
1499 | 0 | { |
1500 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("1"))) { |
1501 | 0 | *is_exact = 1; |
1502 | 0 | return 94; |
1503 | 0 | } |
1504 | 0 | *is_exact = 0; |
1505 | 0 | return 94; |
1506 | 0 | } |
1507 | | |
1508 | | int32_t h2o_qpack_lookup_user_agent(h2o_iovec_t value, int *is_exact) |
1509 | 0 | { |
1510 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1511 | 0 | *is_exact = 1; |
1512 | 0 | return 95; |
1513 | 0 | } |
1514 | 0 | *is_exact = 0; |
1515 | 0 | return 95; |
1516 | 0 | } |
1517 | | |
1518 | | int32_t h2o_qpack_lookup_vary(h2o_iovec_t value, int *is_exact) |
1519 | 0 | { |
1520 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("accept-encoding"))) { |
1521 | 0 | *is_exact = 1; |
1522 | 0 | return 59; |
1523 | 0 | } |
1524 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("origin"))) { |
1525 | 0 | *is_exact = 1; |
1526 | 0 | return 60; |
1527 | 0 | } |
1528 | 0 | *is_exact = 0; |
1529 | 0 | return 59; |
1530 | 0 | } |
1531 | | |
1532 | | int32_t h2o_qpack_lookup_via(h2o_iovec_t value, int *is_exact) |
1533 | 0 | { |
1534 | 0 | *is_exact = 0; |
1535 | 0 | return -1; |
1536 | 0 | } |
1537 | | |
1538 | | int32_t h2o_qpack_lookup_www_authenticate(h2o_iovec_t value, int *is_exact) |
1539 | 0 | { |
1540 | 0 | *is_exact = 0; |
1541 | 0 | return -1; |
1542 | 0 | } |
1543 | | |
1544 | | int32_t h2o_qpack_lookup_x_compress_hint(h2o_iovec_t value, int *is_exact) |
1545 | 0 | { |
1546 | 0 | *is_exact = 0; |
1547 | 0 | return -1; |
1548 | 0 | } |
1549 | | |
1550 | | int32_t h2o_qpack_lookup_x_content_type_options(h2o_iovec_t value, int *is_exact) |
1551 | 0 | { |
1552 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("nosniff"))) { |
1553 | 0 | *is_exact = 1; |
1554 | 0 | return 61; |
1555 | 0 | } |
1556 | 0 | *is_exact = 0; |
1557 | 0 | return 61; |
1558 | 0 | } |
1559 | | |
1560 | | int32_t h2o_qpack_lookup_x_forwarded_for(h2o_iovec_t value, int *is_exact) |
1561 | 0 | { |
1562 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) { |
1563 | 0 | *is_exact = 1; |
1564 | 0 | return 96; |
1565 | 0 | } |
1566 | 0 | *is_exact = 0; |
1567 | 0 | return 96; |
1568 | 0 | } |
1569 | | |
1570 | | int32_t h2o_qpack_lookup_x_frame_options(h2o_iovec_t value, int *is_exact) |
1571 | 0 | { |
1572 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("deny"))) { |
1573 | 0 | *is_exact = 1; |
1574 | 0 | return 97; |
1575 | 0 | } |
1576 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("sameorigin"))) { |
1577 | 0 | *is_exact = 1; |
1578 | 0 | return 98; |
1579 | 0 | } |
1580 | 0 | *is_exact = 0; |
1581 | 0 | return 97; |
1582 | 0 | } |
1583 | | |
1584 | | int32_t h2o_qpack_lookup_x_reproxy_url(h2o_iovec_t value, int *is_exact) |
1585 | 0 | { |
1586 | 0 | *is_exact = 0; |
1587 | 0 | return -1; |
1588 | 0 | } |
1589 | | |
1590 | | int32_t h2o_qpack_lookup_x_traffic(h2o_iovec_t value, int *is_exact) |
1591 | 0 | { |
1592 | 0 | *is_exact = 0; |
1593 | 0 | return -1; |
1594 | 0 | } |
1595 | | |
1596 | | int32_t h2o_qpack_lookup_x_xss_protection(h2o_iovec_t value, int *is_exact) |
1597 | 0 | { |
1598 | 0 | if (h2o_memis(value.base, value.len, H2O_STRLIT("1; mode=block"))) { |
1599 | 0 | *is_exact = 1; |
1600 | 0 | return 62; |
1601 | 0 | } |
1602 | 0 | *is_exact = 0; |
1603 | 0 | return 62; |
1604 | 0 | } |
1605 | | |
1606 | | const h2o_qpack_lookup_static_cb h2o_qpack_lookup_static[85] = {h2o_qpack_lookup_authority, |
1607 | | h2o_qpack_lookup_method, |
1608 | | h2o_qpack_lookup_path, |
1609 | | h2o_qpack_lookup_protocol, |
1610 | | h2o_qpack_lookup_scheme, |
1611 | | h2o_qpack_lookup_status, |
1612 | | h2o_qpack_lookup_accept, |
1613 | | h2o_qpack_lookup_accept_charset, |
1614 | | h2o_qpack_lookup_accept_encoding, |
1615 | | h2o_qpack_lookup_accept_language, |
1616 | | h2o_qpack_lookup_accept_ranges, |
1617 | | h2o_qpack_lookup_access_control_allow_credentials, |
1618 | | h2o_qpack_lookup_access_control_allow_headers, |
1619 | | h2o_qpack_lookup_access_control_allow_methods, |
1620 | | h2o_qpack_lookup_access_control_allow_origin, |
1621 | | h2o_qpack_lookup_access_control_expose_headers, |
1622 | | h2o_qpack_lookup_access_control_request_headers, |
1623 | | h2o_qpack_lookup_access_control_request_method, |
1624 | | h2o_qpack_lookup_age, |
1625 | | h2o_qpack_lookup_allow, |
1626 | | h2o_qpack_lookup_alt_svc, |
1627 | | h2o_qpack_lookup_authorization, |
1628 | | h2o_qpack_lookup_cache_control, |
1629 | | h2o_qpack_lookup_cache_digest, |
1630 | | h2o_qpack_lookup_connection, |
1631 | | h2o_qpack_lookup_content_disposition, |
1632 | | h2o_qpack_lookup_content_encoding, |
1633 | | h2o_qpack_lookup_content_language, |
1634 | | h2o_qpack_lookup_content_length, |
1635 | | h2o_qpack_lookup_content_location, |
1636 | | h2o_qpack_lookup_content_range, |
1637 | | h2o_qpack_lookup_content_security_policy, |
1638 | | h2o_qpack_lookup_content_type, |
1639 | | h2o_qpack_lookup_cookie, |
1640 | | h2o_qpack_lookup_datagram_flow_id, |
1641 | | h2o_qpack_lookup_date, |
1642 | | h2o_qpack_lookup_early_data, |
1643 | | h2o_qpack_lookup_etag, |
1644 | | h2o_qpack_lookup_expect, |
1645 | | h2o_qpack_lookup_expect_ct, |
1646 | | h2o_qpack_lookup_expires, |
1647 | | h2o_qpack_lookup_forwarded, |
1648 | | h2o_qpack_lookup_from, |
1649 | | h2o_qpack_lookup_host, |
1650 | | h2o_qpack_lookup_http2_settings, |
1651 | | h2o_qpack_lookup_if_match, |
1652 | | h2o_qpack_lookup_if_modified_since, |
1653 | | h2o_qpack_lookup_if_none_match, |
1654 | | h2o_qpack_lookup_if_range, |
1655 | | h2o_qpack_lookup_if_unmodified_since, |
1656 | | h2o_qpack_lookup_keep_alive, |
1657 | | h2o_qpack_lookup_last_modified, |
1658 | | h2o_qpack_lookup_link, |
1659 | | h2o_qpack_lookup_location, |
1660 | | h2o_qpack_lookup_max_forwards, |
1661 | | h2o_qpack_lookup_no_early_hints, |
1662 | | h2o_qpack_lookup_origin, |
1663 | | h2o_qpack_lookup_priority, |
1664 | | h2o_qpack_lookup_proxy_authenticate, |
1665 | | h2o_qpack_lookup_proxy_authorization, |
1666 | | h2o_qpack_lookup_proxy_connection, |
1667 | | h2o_qpack_lookup_purpose, |
1668 | | h2o_qpack_lookup_range, |
1669 | | h2o_qpack_lookup_referer, |
1670 | | h2o_qpack_lookup_refresh, |
1671 | | h2o_qpack_lookup_retry_after, |
1672 | | h2o_qpack_lookup_server, |
1673 | | h2o_qpack_lookup_set_cookie, |
1674 | | h2o_qpack_lookup_strict_transport_security, |
1675 | | h2o_qpack_lookup_te, |
1676 | | h2o_qpack_lookup_timing_allow_origin, |
1677 | | h2o_qpack_lookup_transfer_encoding, |
1678 | | h2o_qpack_lookup_upgrade, |
1679 | | h2o_qpack_lookup_upgrade_insecure_requests, |
1680 | | h2o_qpack_lookup_user_agent, |
1681 | | h2o_qpack_lookup_vary, |
1682 | | h2o_qpack_lookup_via, |
1683 | | h2o_qpack_lookup_www_authenticate, |
1684 | | h2o_qpack_lookup_x_compress_hint, |
1685 | | h2o_qpack_lookup_x_content_type_options, |
1686 | | h2o_qpack_lookup_x_forwarded_for, |
1687 | | h2o_qpack_lookup_x_frame_options, |
1688 | | h2o_qpack_lookup_x_reproxy_url, |
1689 | | h2o_qpack_lookup_x_traffic, |
1690 | | h2o_qpack_lookup_x_xss_protection}; |