• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: [(&str, &str); 99] = [
28     (":authority", ""),
29     (":path", "/"),
30     ("age", "0"),
31     ("content-disposition", ""),
32     ("content-length", "0"),
33     ("cookie", ""),
34     ("date", ""),
35     ("etag", ""),
36     ("if-modified-since", ""),
37     ("if-none-match", ""),
38     ("last-modified", ""),
39     ("link", ""),
40     ("location", ""),
41     ("referer", ""),
42     ("set-cookie", ""),
43     (":method", "CONNECT"),
44     (":method", "DELETE"),
45     (":method", "GET"),
46     (":method", "HEAD"),
47     (":method", "OPTIONS"),
48     (":method", "POST"),
49     (":method", "PUT"),
50     (":scheme", "http"),
51     (":scheme", "https"),
52     (":status", "103"),
53     (":status", "200"),
54     (":status", "304"),
55     (":status", "404"),
56     (":status", "503"),
57     ("accept", "*/*"),
58     ("accept", "application/dns-message"),
59     ("accept-encoding", "gzip, deflate, br"),
60     ("accept-ranges", "bytes"),
61     ("access-control-allow-headers", "cache-control"),
62     ("access-control-allow-headers", "content-type"),
63     ("access-control-allow-origin", "*"),
64     ("cache-control", "max-age=0"),
65     ("cache-control", "max-age=2592000"),
66     ("cache-control", "max-age=604800"),
67     ("cache-control", "no-cache"),
68     ("cache-control", "no-store"),
69     ("cache-control", "public, max-age=31536000"),
70     ("content-encoding", "br"),
71     ("content-encoding", "gzip"),
72     ("content-type", "application/dns-message"),
73     ("content-type", "application/javascript"),
74     ("content-type", "application/json"),
75     ("content-type", "application/x-www-form-urlencoded"),
76     ("content-type", "image/gif"),
77     ("content-type", "image/jpeg"),
78     ("content-type", "image/png"),
79     ("content-type", "text/css"),
80     ("content-type", "text/html; charset=utf-8"),
81     ("content-type", "text/plain"),
82     ("content-type", "text/plain;charset=utf-8"),
83     ("range", "bytes=0-"),
84     ("strict-transport-security", "max-age=31536000"),
85     (
86         "strict-transport-security",
87         "max-age=31536000; includesubdomains",
88     ),
89     (
90         "strict-transport-security",
91         "max-age=31536000; includesubdomains; preload",
92     ),
93     ("vary", "accept-encoding"),
94     ("vary", "origin"),
95     ("x-content-type-options", "nosniff"),
96     ("x-xss-protection", "1; mode=block"),
97     (":status", "100"),
98     (":status", "204"),
99     (":status", "206"),
100     (":status", "302"),
101     (":status", "400"),
102     (":status", "403"),
103     (":status", "421"),
104     (":status", "425"),
105     (":status", "500"),
106     ("accept-language", ""),
107     ("access-control-allow-credentials", "FALSE"),
108     ("access-control-allow-credentials", "TRUE"),
109     ("access-control-allow-headers", "*"),
110     ("access-control-allow-methods", "get"),
111     ("access-control-allow-methods", "get, post, options"),
112     ("access-control-allow-methods", "options"),
113     ("access-control-expose-headers", "content-length"),
114     ("access-control-request-headers", "content-type"),
115     ("access-control-request-method", "get"),
116     ("access-control-request-method", "post"),
117     ("alt-svc", "clear"),
118     ("authorization", ""),
119     (
120         "content-security-policy",
121         "script-src 'none'; object-src 'none'; base-uri 'none'",
122     ),
123     ("early-data", "1"),
124     ("expect-ct", ""),
125     ("forwarded", ""),
126     ("if-range", ""),
127     ("origin", ""),
128     ("purpose", "prefetch"),
129     ("server", ""),
130     ("timing-allow-origin", "*"),
131     ("upgrade-insecure-requests", "1"),
132     ("user-agent", ""),
133     ("x-forwarded-for", ""),
134     ("x-frame-options", "deny"),
135     ("x-frame-options", "sameorigin"),
136 ];
137