Coverage Report

Created: 2026-06-10 06:21

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/h2o/lib/common/token_table.h
Line
Count
Source
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
160k
{
276
160k
    switch (len) {
277
3.93k
    case 2:
278
3.93k
        switch (name[1]) {
279
1.98k
        case 'e':
280
1.98k
            if (memcmp(name, "t", 1) == 0)
281
819
                return H2O_TOKEN_TE;
282
1.16k
            break;
283
3.93k
        }
284
3.11k
        break;
285
7.39k
    case 3:
286
7.39k
        switch (name[2]) {
287
2.19k
        case 'a':
288
2.19k
            if (memcmp(name, "vi", 2) == 0)
289
1.26k
                return H2O_TOKEN_VIA;
290
935
            break;
291
2.58k
        case 'e':
292
2.58k
            if (memcmp(name, "ag", 2) == 0)
293
1.12k
                return H2O_TOKEN_AGE;
294
1.45k
            break;
295
7.39k
        }
296
5.01k
        break;
297
14.2k
    case 4:
298
14.2k
        switch (name[3]) {
299
3.24k
        case 'e':
300
3.24k
            if (memcmp(name, "dat", 3) == 0)
301
1.47k
                return H2O_TOKEN_DATE;
302
1.77k
            break;
303
2.04k
        case 'g':
304
2.04k
            if (memcmp(name, "eta", 3) == 0)
305
795
                return H2O_TOKEN_ETAG;
306
1.25k
            break;
307
1.25k
        case 'k':
308
1.07k
            if (memcmp(name, "lin", 3) == 0)
309
448
                return H2O_TOKEN_LINK;
310
624
            break;
311
1.71k
        case 'm':
312
1.71k
            if (memcmp(name, "fro", 3) == 0)
313
819
                return H2O_TOKEN_FROM;
314
893
            break;
315
2.45k
        case 't':
316
2.45k
            if (memcmp(name, "hos", 3) == 0)
317
1.42k
                return H2O_TOKEN_HOST;
318
1.03k
            break;
319
1.13k
        case 'y':
320
1.13k
            if (memcmp(name, "var", 3) == 0)
321
411
                return H2O_TOKEN_VARY;
322
727
            break;
323
14.2k
        }
324
8.87k
        break;
325
8.87k
    case 5:
326
4.11k
        switch (name[4]) {
327
1.34k
        case 'e':
328
1.34k
            if (memcmp(name, "rang", 4) == 0)
329
752
                return H2O_TOKEN_RANGE;
330
594
            break;
331
594
        case 'h':
332
306
            if (memcmp(name, ":pat", 4) == 0)
333
6
                return H2O_TOKEN_PATH;
334
300
            break;
335
748
        case 'w':
336
748
            if (memcmp(name, "allo", 4) == 0)
337
291
                return H2O_TOKEN_ALLOW;
338
457
            break;
339
4.11k
        }
340
3.06k
        break;
341
11.1k
    case 6:
342
11.1k
        switch (name[5]) {
343
3.86k
        case 'e':
344
3.86k
            if (memcmp(name, "cooki", 5) == 0)
345
2.49k
                return H2O_TOKEN_COOKIE;
346
1.36k
            break;
347
1.60k
        case 'n':
348
1.60k
            if (memcmp(name, "origi", 5) == 0)
349
432
                return H2O_TOKEN_ORIGIN;
350
1.17k
            break;
351
1.79k
        case 'r':
352
1.79k
            if (memcmp(name, "serve", 5) == 0)
353
364
                return H2O_TOKEN_SERVER;
354
1.43k
            break;
355
2.13k
        case 't':
356
2.13k
            if (memcmp(name, "accep", 5) == 0)
357
540
                return H2O_TOKEN_ACCEPT;
358
1.59k
            if (memcmp(name, "expec", 5) == 0)
359
536
                return H2O_TOKEN_EXPECT;
360
1.06k
            break;
361
11.1k
        }
362
6.76k
        break;
363
9.17k
    case 7:
364
9.17k
        switch (name[6]) {
365
913
        case 'c':
366
913
            if (memcmp(name, "alt-sv", 6) == 0)
367
381
                return H2O_TOKEN_ALT_SVC;
368
532
            break;
369
1.51k
        case 'd':
370
1.51k
            if (memcmp(name, ":metho", 6) == 0)
371
7
                return H2O_TOKEN_METHOD;
372
1.51k
            break;
373
2.41k
        case 'e':
374
2.41k
            if (memcmp(name, ":schem", 6) == 0)
375
7
                return H2O_TOKEN_SCHEME;
376
2.40k
            if (memcmp(name, "purpos", 6) == 0)
377
442
                return H2O_TOKEN_PURPOSE;
378
1.96k
            if (memcmp(name, "upgrad", 6) == 0)
379
1.23k
                return H2O_TOKEN_UPGRADE;
380
722
            break;
381
722
        case 'h':
382
585
            if (memcmp(name, "refres", 6) == 0)
383
203
                return H2O_TOKEN_REFRESH;
384
382
            break;
385
1.36k
        case 'r':
386
1.36k
            if (memcmp(name, "refere", 6) == 0)
387
446
                return H2O_TOKEN_REFERER;
388
922
            break;
389
964
        case 's':
390
964
            if (memcmp(name, ":statu", 6) == 0)
391
2
                return H2O_TOKEN_STATUS;
392
962
            if (memcmp(name, "expire", 6) == 0)
393
458
                return H2O_TOKEN_EXPIRES;
394
504
            break;
395
9.17k
        }
396
5.99k
        break;
397
6.90k
    case 8:
398
6.90k
        switch (name[7]) {
399
1.54k
        case 'e':
400
1.54k
            if (memcmp(name, "if-rang", 7) == 0)
401
671
                return H2O_TOKEN_IF_RANGE;
402
876
            break;
403
876
        case 'h':
404
776
            if (memcmp(name, "if-matc", 7) == 0)
405
361
                return H2O_TOKEN_IF_MATCH;
406
415
            break;
407
1.16k
        case 'n':
408
1.16k
            if (memcmp(name, "locatio", 7) == 0)
409
341
                return H2O_TOKEN_LOCATION;
410
826
            break;
411
2.00k
        case 'y':
412
2.00k
            if (memcmp(name, "priorit", 7) == 0)
413
1.41k
                return H2O_TOKEN_PRIORITY;
414
588
            break;
415
6.90k
        }
416
4.11k
        break;
417
4.50k
    case 9:
418
4.50k
        switch (name[8]) {
419
896
        case 'c':
420
896
            if (memcmp(name, "x-traffi", 8) == 0)
421
176
                return H2O_TOKEN_X_TRAFFIC;
422
720
            break;
423
720
        case 'd':
424
662
            if (memcmp(name, "forwarde", 8) == 0)
425
218
                return H2O_TOKEN_FORWARDED;
426
444
            break;
427
444
        case 'l':
428
394
            if (memcmp(name, ":protoco", 8) == 0)
429
10
                return H2O_TOKEN_PROTOCOL;
430
384
            break;
431
1.36k
        case 't':
432
1.36k
            if (memcmp(name, "expect-c", 8) == 0)
433
303
                return H2O_TOKEN_EXPECT_CT;
434
1.06k
            break;
435
4.50k
        }
436
3.79k
        break;
437
12.6k
    case 10:
438
12.6k
        switch (name[9]) {
439
1.10k
        case 'a':
440
1.10k
            if (memcmp(name, "early-dat", 9) == 0)
441
466
                return H2O_TOKEN_EARLY_DATA;
442
634
            break;
443
1.76k
        case 'e':
444
1.76k
            if (memcmp(name, "keep-aliv", 9) == 0)
445
179
                return H2O_TOKEN_KEEP_ALIVE;
446
1.58k
            if (memcmp(name, "set-cooki", 9) == 0)
447
749
                return H2O_TOKEN_SET_COOKIE;
448
837
            break;
449
5.38k
        case 'n':
450
5.38k
            if (memcmp(name, "connectio", 9) == 0)
451
4.78k
                return H2O_TOKEN_CONNECTION;
452
596
            break;
453
1.57k
        case 't':
454
1.57k
            if (memcmp(name, "user-agen", 9) == 0)
455
599
                return H2O_TOKEN_USER_AGENT;
456
977
            break;
457
1.03k
        case 'y':
458
1.03k
            if (memcmp(name, ":authorit", 9) == 0)
459
7
                return H2O_TOKEN_AUTHORITY;
460
1.02k
            break;
461
12.6k
        }
462
5.83k
        break;
463
5.83k
    case 11:
464
2.00k
        switch (name[10]) {
465
752
        case 'r':
466
752
            if (memcmp(name, "retry-afte", 10) == 0)
467
207
                return H2O_TOKEN_RETRY_AFTER;
468
545
            break;
469
2.00k
        }
470
1.79k
        break;
471
4.72k
    case 12:
472
4.72k
        switch (name[11]) {
473
877
        case 'e':
474
877
            if (memcmp(name, "content-typ", 11) == 0)
475
248
                return H2O_TOKEN_CONTENT_TYPE;
476
629
            break;
477
1.01k
        case 's':
478
1.01k
            if (memcmp(name, "max-forward", 11) == 0)
479
445
                return H2O_TOKEN_MAX_FORWARDS;
480
570
            break;
481
1.78k
        case 't':
482
1.78k
            if (memcmp(name, "cache-diges", 11) == 0)
483
1.33k
                return H2O_TOKEN_CACHE_DIGEST;
484
453
            break;
485
4.72k
        }
486
2.70k
        break;
487
6.73k
    case 13:
488
6.73k
        switch (name[12]) {
489
438
        case 'd':
490
438
            if (memcmp(name, "last-modifie", 12) == 0)
491
153
                return H2O_TOKEN_LAST_MODIFIED;
492
285
            break;
493
613
        case 'e':
494
613
            if (memcmp(name, "content-rang", 12) == 0)
495
191
                return H2O_TOKEN_CONTENT_RANGE;
496
422
            break;
497
809
        case 'h':
498
809
            if (memcmp(name, "if-none-matc", 12) == 0)
499
302
                return H2O_TOKEN_IF_NONE_MATCH;
500
507
            break;
501
1.67k
        case 'l':
502
1.67k
            if (memcmp(name, "cache-contro", 12) == 0)
503
537
                return H2O_TOKEN_CACHE_CONTROL;
504
1.13k
            if (memcmp(name, "x-reproxy-ur", 12) == 0)
505
214
                return H2O_TOKEN_X_REPROXY_URL;
506
920
            break;
507
920
        case 'n':
508
708
            if (memcmp(name, "authorizatio", 12) == 0)
509
318
                return H2O_TOKEN_AUTHORIZATION;
510
390
            break;
511
778
        case 's':
512
778
            if (memcmp(name, "accept-range", 12) == 0)
513
283
                return H2O_TOKEN_ACCEPT_RANGES;
514
495
            break;
515
6.73k
        }
516
4.73k
        break;
517
5.54k
    case 14:
518
5.54k
        switch (name[13]) {
519
1.47k
        case 'h':
520
1.47k
            if (memcmp(name, "content-lengt", 13) == 0)
521
1.23k
                return H2O_TOKEN_CONTENT_LENGTH;
522
242
            break;
523
1.77k
        case 's':
524
1.77k
            if (memcmp(name, "http2-setting", 13) == 0)
525
788
                return H2O_TOKEN_HTTP2_SETTINGS;
526
982
            if (memcmp(name, "no-early-hint", 13) == 0)
527
193
                return H2O_TOKEN_NO_EARLY_HINTS;
528
789
            break;
529
1.39k
        case 't':
530
1.39k
            if (memcmp(name, "accept-charse", 13) == 0)
531
223
                return H2O_TOKEN_ACCEPT_CHARSET;
532
1.17k
            break;
533
5.54k
        }
534
3.11k
        break;
535
4.93k
    case 15:
536
4.93k
        switch (name[14]) {
537
765
        case 'e':
538
765
            if (memcmp(name, "accept-languag", 14) == 0)
539
201
                return H2O_TOKEN_ACCEPT_LANGUAGE;
540
564
            break;
541
564
        case 'g':
542
555
            if (memcmp(name, "accept-encodin", 14) == 0)
543
154
                return H2O_TOKEN_ACCEPT_ENCODING;
544
401
            break;
545
1.42k
        case 'r':
546
1.42k
            if (memcmp(name, "x-forwarded-fo", 14) == 0)
547
1.05k
                return H2O_TOKEN_X_FORWARDED_FOR;
548
368
            break;
549
624
        case 's':
550
624
            if (memcmp(name, "x-frame-option", 14) == 0)
551
244
                return H2O_TOKEN_X_FRAME_OPTIONS;
552
380
            break;
553
706
        case 't':
554
706
            if (memcmp(name, "x-compress-hin", 14) == 0)
555
210
                return H2O_TOKEN_X_COMPRESS_HINT;
556
496
            break;
557
4.93k
        }
558
3.06k
        break;
559
5.11k
    case 16:
560
5.11k
        switch (name[15]) {
561
1.09k
        case 'd':
562
1.09k
            if (memcmp(name, "datagram-flow-i", 15) == 0)
563
301
                return H2O_TOKEN_DATAGRAM_FLOW_ID;
564
792
            break;
565
1.03k
        case 'e':
566
1.03k
            if (memcmp(name, "content-languag", 15) == 0)
567
337
                return H2O_TOKEN_CONTENT_LANGUAGE;
568
701
            if (memcmp(name, "www-authenticat", 15) == 0)
569
149
                return H2O_TOKEN_WWW_AUTHENTICATE;
570
552
            break;
571
552
        case 'g':
572
542
            if (memcmp(name, "content-encodin", 15) == 0)
573
202
                return H2O_TOKEN_CONTENT_ENCODING;
574
340
            break;
575
1.59k
        case 'n':
576
1.59k
            if (memcmp(name, "content-locatio", 15) == 0)
577
339
                return H2O_TOKEN_CONTENT_LOCATION;
578
1.25k
            if (memcmp(name, "proxy-connectio", 15) == 0)
579
440
                return H2O_TOKEN_PROXY_CONNECTION;
580
817
            if (memcmp(name, "x-xss-protectio", 15) == 0)
581
169
                return H2O_TOKEN_X_XSS_PROTECTION;
582
648
            break;
583
5.11k
        }
584
3.17k
        break;
585
3.22k
    case 17:
586
3.22k
        switch (name[16]) {
587
884
        case 'e':
588
884
            if (memcmp(name, "if-modified-sinc", 16) == 0)
589
306
                return H2O_TOKEN_IF_MODIFIED_SINCE;
590
578
            break;
591
1.21k
        case 'g':
592
1.21k
            if (memcmp(name, "transfer-encodin", 16) == 0)
593
700
                return H2O_TOKEN_TRANSFER_ENCODING;
594
512
            break;
595
3.22k
        }
596
2.22k
        break;
597
2.22k
    case 18:
598
1.68k
        switch (name[17]) {
599
860
        case 'e':
600
860
            if (memcmp(name, "proxy-authenticat", 17) == 0)
601
402
                return H2O_TOKEN_PROXY_AUTHENTICATE;
602
458
            break;
603
1.68k
        }
604
1.28k
        break;
605
2.78k
    case 19:
606
2.78k
        switch (name[18]) {
607
859
        case 'e':
608
859
            if (memcmp(name, "if-unmodified-sinc", 18) == 0)
609
465
                return H2O_TOKEN_IF_UNMODIFIED_SINCE;
610
394
            break;
611
1.25k
        case 'n':
612
1.25k
            if (memcmp(name, "content-dispositio", 18) == 0)
613
418
                return H2O_TOKEN_CONTENT_DISPOSITION;
614
839
            if (memcmp(name, "proxy-authorizatio", 18) == 0)
615
209
                return H2O_TOKEN_PROXY_AUTHORIZATION;
616
630
            if (memcmp(name, "timing-allow-origi", 18) == 0)
617
236
                return H2O_TOKEN_TIMING_ALLOW_ORIGIN;
618
394
            break;
619
2.78k
        }
620
1.46k
        break;
621
1.46k
    case 22:
622
1.15k
        switch (name[21]) {
623
720
        case 's':
624
720
            if (memcmp(name, "x-content-type-option", 21) == 0)
625
307
                return H2O_TOKEN_X_CONTENT_TYPE_OPTIONS;
626
413
            break;
627
1.15k
        }
628
850
        break;
629
1.14k
    case 23:
630
1.14k
        switch (name[22]) {
631
602
        case 'y':
632
602
            if (memcmp(name, "content-security-polic", 22) == 0)
633
210
                return H2O_TOKEN_CONTENT_SECURITY_POLICY;
634
392
            break;
635
1.14k
        }
636
935
        break;
637
1.19k
    case 25:
638
1.19k
        switch (name[24]) {
639
432
        case 's':
640
432
            if (memcmp(name, "upgrade-insecure-request", 24) == 0)
641
157
                return H2O_TOKEN_UPGRADE_INSECURE_REQUESTS;
642
275
            break;
643
426
        case 'y':
644
426
            if (memcmp(name, "strict-transport-securit", 24) == 0)
645
164
                return H2O_TOKEN_STRICT_TRANSPORT_SECURITY;
646
262
            break;
647
1.19k
        }
648
875
        break;
649
875
    case 27:
650
684
        switch (name[26]) {
651
377
        case 'n':
652
377
            if (memcmp(name, "access-control-allow-origi", 26) == 0)
653
151
                return H2O_TOKEN_ACCESS_CONTROL_ALLOW_ORIGIN;
654
226
            break;
655
684
        }
656
533
        break;
657
1.14k
    case 28:
658
1.14k
        switch (name[27]) {
659
812
        case 's':
660
812
            if (memcmp(name, "access-control-allow-header", 27) == 0)
661
315
                return H2O_TOKEN_ACCESS_CONTROL_ALLOW_HEADERS;
662
497
            if (memcmp(name, "access-control-allow-method", 27) == 0)
663
213
                return H2O_TOKEN_ACCESS_CONTROL_ALLOW_METHODS;
664
284
            break;
665
1.14k
        }
666
616
        break;
667
1.49k
    case 29:
668
1.49k
        switch (name[28]) {
669
587
        case 'd':
670
587
            if (memcmp(name, "access-control-request-metho", 28) == 0)
671
320
                return H2O_TOKEN_ACCESS_CONTROL_REQUEST_METHOD;
672
267
            break;
673
460
        case 's':
674
460
            if (memcmp(name, "access-control-expose-header", 28) == 0)
675
190
                return H2O_TOKEN_ACCESS_CONTROL_EXPOSE_HEADERS;
676
270
            break;
677
1.49k
        }
678
985
        break;
679
985
    case 30:
680
831
        switch (name[29]) {
681
457
        case 's':
682
457
            if (memcmp(name, "access-control-request-header", 29) == 0)
683
170
                return H2O_TOKEN_ACCESS_CONTROL_REQUEST_HEADERS;
684
287
            break;
685
831
        }
686
661
        break;
687
1.09k
    case 32:
688
1.09k
        switch (name[31]) {
689
687
        case 's':
690
687
            if (memcmp(name, "access-control-allow-credential", 31) == 0)
691
197
                return H2O_TOKEN_ACCESS_CONTROL_ALLOW_CREDENTIALS;
692
490
            break;
693
1.09k
        }
694
900
        break;
695
160k
    }
696
697
117k
    return NULL;
698
160k
}
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.23k
{
1122
1.23k
    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.23k
    if (h2o_memis(value.base, value.len, H2O_STRLIT("application/javascript"))) {
1127
0
        *is_exact = 1;
1128
0
        return 45;
1129
0
    }
1130
1.23k
    if (h2o_memis(value.base, value.len, H2O_STRLIT("application/json"))) {
1131
0
        *is_exact = 1;
1132
0
        return 46;
1133
0
    }
1134
1.23k
    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.23k
    if (h2o_memis(value.base, value.len, H2O_STRLIT("image/gif"))) {
1139
0
        *is_exact = 1;
1140
0
        return 48;
1141
0
    }
1142
1.23k
    if (h2o_memis(value.base, value.len, H2O_STRLIT("image/jpeg"))) {
1143
0
        *is_exact = 1;
1144
0
        return 49;
1145
0
    }
1146
1.23k
    if (h2o_memis(value.base, value.len, H2O_STRLIT("image/png"))) {
1147
0
        *is_exact = 1;
1148
0
        return 50;
1149
0
    }
1150
1.23k
    if (h2o_memis(value.base, value.len, H2O_STRLIT("text/css"))) {
1151
0
        *is_exact = 1;
1152
0
        return 51;
1153
0
    }
1154
1.23k
    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.23k
    if (h2o_memis(value.base, value.len, H2O_STRLIT("text/plain"))) {
1159
0
        *is_exact = 1;
1160
0
        return 53;
1161
0
    }
1162
1.23k
    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.23k
    *is_exact = 0;
1167
1.23k
    return 44;
1168
1.23k
}
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
381
{
1188
381
    if (h2o_memis(value.base, value.len, H2O_STRLIT(""))) {
1189
0
        *is_exact = 1;
1190
0
        return 6;
1191
0
    }
1192
381
    *is_exact = 0;
1193
381
    return 6;
1194
381
}
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};