blob: b30dc741fc8e6315f40ca3dc3313d39c457d639f [file] [log] [blame]
Frédéric Lécaille164096e2020-12-22 16:01:57 +01001/*
2 * QPACK header table management (draft-ietf-quic-qpack-20)
3 *
4 * Copyright 2020 HAProxy Technologies, Frédéric Lécaille <flecaille@haproxy.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be
15 * included in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 * OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27#include <import/ist.h>
28#include <haproxy/http-hdr-t.h>
29#include <haproxy/qpack-tbl-t.h>
30
Frédéric Lécailled341fc32020-12-22 16:08:51 +010031/* static header table as in draft-ietf-quic-qpack-20 Appendix A. [0] unused. */
Frédéric Lécaille164096e2020-12-22 16:01:57 +010032const struct http_hdr qpack_sht[QPACK_SHT_SIZE] = {
33 [ 0] = { .n = IST(":authority"), .v = IST("") },
34 [ 1] = { .n = IST(":path"), .v = IST("/") },
35 [ 2] = { .n = IST("age"), .v = IST("0") },
36 [ 3] = { .n = IST("content-disposition"), .v = IST("") },
37 [ 4] = { .n = IST("content-length"), .v = IST("0") },
38 [ 5] = { .n = IST("cookie"), .v = IST("") },
39 [ 6] = { .n = IST("date"), .v = IST("") },
40 [ 7] = { .n = IST("etag"), .v = IST("") },
41 [ 8] = { .n = IST("if-modified-since"), .v = IST("") },
42 [ 9] = { .n = IST("if-none-match"), .v = IST("") },
43 [10] = { .n = IST("last-modified"), .v = IST("") },
44 [11] = { .n = IST("link"), .v = IST("") },
45 [12] = { .n = IST("location"), .v = IST("") },
46 [13] = { .n = IST("referer"), .v = IST("") },
47 [14] = { .n = IST("set-cookie"), .v = IST("") },
48 [15] = { .n = IST(":method"), .v = IST("CONNECT") },
49 [16] = { .n = IST(":method"), .v = IST("DELETE") },
50 [17] = { .n = IST(":method"), .v = IST("GET") },
51 [18] = { .n = IST(":method"), .v = IST("HEAD") },
52 [19] = { .n = IST(":method"), .v = IST("OPTIONS") },
53 [20] = { .n = IST(":method"), .v = IST("POST") },
54 [21] = { .n = IST(":method"), .v = IST("PUT") },
55 [22] = { .n = IST(":scheme"), .v = IST("http") },
56 [23] = { .n = IST(":scheme"), .v = IST("https") },
57 [24] = { .n = IST(":status"), .v = IST("103") },
58 [25] = { .n = IST(":status"), .v = IST("200") },
59 [26] = { .n = IST(":status"), .v = IST("304") },
60 [27] = { .n = IST(":status"), .v = IST("404") },
61 [28] = { .n = IST(":status"), .v = IST("503") },
62 [29] = { .n = IST("accept"), .v = IST("*/*") },
63 [30] = { .n = IST("accept"), .v = IST("application/dns-message") },
64 [31] = { .n = IST("accept-encoding"), .v = IST("gzip, deflate, br") },
65 [32] = { .n = IST("accept-ranges"), .v = IST("bytes") },
66 [33] = { .n = IST("access-control-allow-headers"), .v = IST("cache-control") },
67 [34] = { .n = IST("access-control-allow-headers"), .v = IST("content-type") },
68 [35] = { .n = IST("access-control-allow-origin"), .v = IST("*") },
69 [36] = { .n = IST("cache-control"), .v = IST("max-age=0") },
70 [37] = { .n = IST("cache-control"), .v = IST("max-age=2592000") },
71 [38] = { .n = IST("cache-control"), .v = IST("max-age=604800") },
72 [39] = { .n = IST("cache-control"), .v = IST("no-cache") },
73 [40] = { .n = IST("cache-control"), .v = IST("no-store") },
74 [41] = { .n = IST("cache-control"), .v = IST("public, max-age=31536000") },
75 [42] = { .n = IST("content-encoding"), .v = IST("br") },
76 [43] = { .n = IST("content-encoding"), .v = IST("gzip") },
77 [44] = { .n = IST("content-type"), .v = IST("application/dns-message") },
78 [45] = { .n = IST("content-type"), .v = IST("application/javascript") },
79 [46] = { .n = IST("content-type"), .v = IST("application/json") },
80 [47] = { .n = IST("content-type"), .v = IST("application/"
81 "x-www-form-urlencoded") },
82 [48] = { .n = IST("content-type"), .v = IST("image/gif") },
83 [49] = { .n = IST("content-type"), .v = IST("image/jpeg") },
84 [50] = { .n = IST("content-type"), .v = IST("image/png") },
85 [51] = { .n = IST("content-type"), .v = IST("text/css") },
86 [52] = { .n = IST("content-type"), .v = IST("text/html;"
87 " charset=utf-8") },
88 [53] = { .n = IST("content-type"), .v = IST("text/plain") },
89 [54] = { .n = IST("content-type"), .v = IST("text/plain;"
90 "charset=utf-8") },
91 [55] = { .n = IST("range"), .v = IST("bytes=0-") },
92 [56] = { .n = IST("strict-transport-security"), .v = IST("max-age=31536000") },
93 [57] = { .n = IST("strict-transport-security"), .v = IST("max-age=31536000;"
94 " includesubdomains") },
95 [58] = { .n = IST("strict-transport-security"), .v = IST("max-age=31536000;"
96 " includesubdomains;"
97 " preload") },
98 [59] = { .n = IST("vary"), .v = IST("accept-encoding") },
99 [60] = { .n = IST("vary"), .v = IST("origin") },
100 [61] = { .n = IST("x-content-type-options"), .v = IST("nosniff") },
101 [62] = { .n = IST("x-xss-protection"), .v = IST("1; mode=block") },
102 [63] = { .n = IST(":status"), .v = IST("100") },
103 [64] = { .n = IST(":status"), .v = IST("204") },
104 [65] = { .n = IST(":status"), .v = IST("206") },
105 [66] = { .n = IST(":status"), .v = IST("302") },
106 [67] = { .n = IST(":status"), .v = IST("400") },
107 [68] = { .n = IST(":status"), .v = IST("403") },
108 [69] = { .n = IST(":status"), .v = IST("421") },
109 [70] = { .n = IST(":status"), .v = IST("425") },
110 [71] = { .n = IST(":status"), .v = IST("500") },
111 [72] = { .n = IST("accept-language"), .v = IST("") },
112 [73] = { .n = IST("access-control-allow-credentials"), .v = IST("FALSE") },
113 [74] = { .n = IST("access-control-allow-credentials"), .v = IST("TRUE") },
114 [75] = { .n = IST("access-control-allow-headers"), .v = IST("*") },
115 [76] = { .n = IST("access-control-allow-methods"), .v = IST("get") },
116 [77] = { .n = IST("access-control-allow-methods"), .v = IST("get, post, options") },
117 [78] = { .n = IST("access-control-allow-methods"), .v = IST("options") },
118 [79] = { .n = IST("access-control-expose-headers"), .v = IST("content-length") },
119 [80] = { .n = IST("access-control-request-headers"), .v = IST("content-type") },
120 [81] = { .n = IST("access-control-request-method"), .v = IST("get") },
121 [82] = { .n = IST("access-control-request-method"), .v = IST("post") },
122 [83] = { .n = IST("alt-svc"), .v = IST("clear") },
123 [84] = { .n = IST("authorization"), .v = IST("") },
124 [85] = { .n = IST("content-security-policy"), .v = IST("script-src 'none';"
125 " object-src 'none';"
126 " base-uri 'none'") },
127 [86] = { .n = IST("early-data"), .v = IST("1") },
128 [87] = { .n = IST("expect-ct"), .v = IST("") },
129 [88] = { .n = IST("forwarded"), .v = IST("") },
130 [89] = { .n = IST("if-range"), .v = IST("") },
131 [90] = { .n = IST("origin"), .v = IST("") },
132 [91] = { .n = IST("purpose"), .v = IST("prefetch") },
133 [92] = { .n = IST("server"), .v = IST("") },
134 [93] = { .n = IST("timing-allow-origin"), .v = IST("*") },
135 [94] = { .n = IST("upgrade-insecure-requests"), .v = IST("1") },
136 [95] = { .n = IST("user-agent"), .v = IST("") },
137 [96] = { .n = IST("x-forwarded-for"), .v = IST("") },
138 [97] = { .n = IST("x-frame-options"), .v = IST("deny") },
139 [98] = { .n = IST("x-frame-options"), .v = IST("sameorigin") },
140};
141