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