1 // Copyright (C) 2020, Cloudflare, Inc.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 //     * Redistributions of source code must retain the above copyright notice,
9 //       this list of conditions and the following disclaimer.
10 //
11 //     * Redistributions in binary form must reproduce the above copyright
12 //       notice, this list of conditions and the following disclaimer in the
13 //       documentation and/or other materials provided with the distribution.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
16 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
19 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 
27 pub const STATIC_TABLE: [(&[u8], &[u8]); 99] = [
28     (b":authority", b""),
29     (b":path", b"/"),
30     (b"age", b"0"),
31     (b"content-disposition", b""),
32     (b"content-length", b"0"),
33     (b"cookie", b""),
34     (b"date", b""),
35     (b"etag", b""),
36     (b"if-modified-since", b""),
37     (b"if-none-match", b""),
38     (b"last-modified", b""),
39     (b"link", b""),
40     (b"location", b""),
41     (b"referer", b""),
42     (b"set-cookie", b""),
43     (b":method", b"CONNECT"),
44     (b":method", b"DELETE"),
45     (b":method", b"GET"),
46     (b":method", b"HEAD"),
47     (b":method", b"OPTIONS"),
48     (b":method", b"POST"),
49     (b":method", b"PUT"),
50     (b":scheme", b"http"),
51     (b":scheme", b"https"),
52     (b":status", b"103"),
53     (b":status", b"200"),
54     (b":status", b"304"),
55     (b":status", b"404"),
56     (b":status", b"503"),
57     (b"accept", b"*/*"),
58     (b"accept", b"application/dns-message"),
59     (b"accept-encoding", b"gzip, deflate, br"),
60     (b"accept-ranges", b"bytes"),
61     (b"access-control-allow-headers", b"cache-control"),
62     (b"access-control-allow-headers", b"content-type"),
63     (b"access-control-allow-origin", b"*"),
64     (b"cache-control", b"max-age=0"),
65     (b"cache-control", b"max-age=2592000"),
66     (b"cache-control", b"max-age=604800"),
67     (b"cache-control", b"no-cache"),
68     (b"cache-control", b"no-store"),
69     (b"cache-control", b"public, max-age=31536000"),
70     (b"content-encoding", b"br"),
71     (b"content-encoding", b"gzip"),
72     (b"content-type", b"application/dns-message"),
73     (b"content-type", b"application/javascript"),
74     (b"content-type", b"application/json"),
75     (b"content-type", b"application/x-www-form-urlencoded"),
76     (b"content-type", b"image/gif"),
77     (b"content-type", b"image/jpeg"),
78     (b"content-type", b"image/png"),
79     (b"content-type", b"text/css"),
80     (b"content-type", b"text/html; charset=utf-8"),
81     (b"content-type", b"text/plain"),
82     (b"content-type", b"text/plain;charset=utf-8"),
83     (b"range", b"bytes=0-"),
84     (b"strict-transport-security", b"max-age=31536000"),
85     (
86         b"strict-transport-security",
87         b"max-age=31536000; includesubdomains",
88     ),
89     (
90         b"strict-transport-security",
91         b"max-age=31536000; includesubdomains; preload",
92     ),
93     (b"vary", b"accept-encoding"),
94     (b"vary", b"origin"),
95     (b"x-content-type-options", b"nosniff"),
96     (b"x-xss-protection", b"1; mode=block"),
97     (b":status", b"100"),
98     (b":status", b"204"),
99     (b":status", b"206"),
100     (b":status", b"302"),
101     (b":status", b"400"),
102     (b":status", b"403"),
103     (b":status", b"421"),
104     (b":status", b"425"),
105     (b":status", b"500"),
106     (b"accept-language", b""),
107     (b"access-control-allow-credentials", b"FALSE"),
108     (b"access-control-allow-credentials", b"TRUE"),
109     (b"access-control-allow-headers", b"*"),
110     (b"access-control-allow-methods", b"get"),
111     (b"access-control-allow-methods", b"get, post, options"),
112     (b"access-control-allow-methods", b"options"),
113     (b"access-control-expose-headers", b"content-length"),
114     (b"access-control-request-headers", b"content-type"),
115     (b"access-control-request-method", b"get"),
116     (b"access-control-request-method", b"post"),
117     (b"alt-svc", b"clear"),
118     (b"authorization", b""),
119     (
120         b"content-security-policy",
121         b"script-src 'none'; object-src 'none'; base-uri 'none'",
122     ),
123     (b"early-data", b"1"),
124     (b"expect-ct", b""),
125     (b"forwarded", b""),
126     (b"if-range", b""),
127     (b"origin", b""),
128     (b"purpose", b"prefetch"),
129     (b"server", b""),
130     (b"timing-allow-origin", b"*"),
131     (b"upgrade-insecure-requests", b"1"),
132     (b"user-agent", b""),
133     (b"x-forwarded-for", b""),
134     (b"x-frame-options", b"deny"),
135     (b"x-frame-options", b"sameorigin"),
136 ];
137