View Javadoc
1   /*
2    * Copyright 2014 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   https://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  
17  package io.netty.handler.codec.http;
18  
19  import io.netty.util.AsciiString;
20  
21  /**
22   * Standard HTTP header names.
23   * <p>
24   * These are all defined as lowercase to support HTTP/2 requirements while also not
25   * violating HTTP/1.x requirements.  New header names should always be lowercase.
26   */
27  public final class HttpHeaderNames {
28      /**
29       * {@code "accept"}
30       */
31      public static final AsciiString ACCEPT = AsciiString.cached("accept");
32      /**
33       * {@code "accept-charset"}
34       */
35      public static final AsciiString ACCEPT_CHARSET = AsciiString.cached("accept-charset");
36      /**
37       * {@code "accept-encoding"}
38       */
39      public static final AsciiString ACCEPT_ENCODING = AsciiString.cached("accept-encoding");
40      /**
41       * {@code "accept-language"}
42       */
43      public static final AsciiString ACCEPT_LANGUAGE = AsciiString.cached("accept-language");
44      /**
45       * {@code "accept-ranges"}
46       */
47      public static final AsciiString ACCEPT_RANGES = AsciiString.cached("accept-ranges");
48      /**
49       * {@code "accept-patch"}
50       */
51      public static final AsciiString ACCEPT_PATCH = AsciiString.cached("accept-patch");
52      /**
53       * {@code "accept-query"}
54       */
55      public static final AsciiString ACCEPT_QUERY = AsciiString.cached("accept-query");
56      /**
57       * {@code "access-control-allow-credentials"}
58       */
59      public static final AsciiString ACCESS_CONTROL_ALLOW_CREDENTIALS =
60              AsciiString.cached("access-control-allow-credentials");
61      /**
62       * {@code "access-control-allow-headers"}
63       */
64      public static final AsciiString ACCESS_CONTROL_ALLOW_HEADERS =
65              AsciiString.cached("access-control-allow-headers");
66      /**
67       * {@code "access-control-allow-methods"}
68       */
69      public static final AsciiString ACCESS_CONTROL_ALLOW_METHODS =
70              AsciiString.cached("access-control-allow-methods");
71      /**
72       * {@code "access-control-allow-origin"}
73       */
74      public static final AsciiString ACCESS_CONTROL_ALLOW_ORIGIN =
75              AsciiString.cached("access-control-allow-origin");
76      /**
77       * {@code "access-control-allow-origin"}
78       */
79      public static final AsciiString ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK =
80              AsciiString.cached("access-control-allow-private-network");
81      /**
82       * {@code "access-control-expose-headers"}
83       */
84      public static final AsciiString ACCESS_CONTROL_EXPOSE_HEADERS =
85              AsciiString.cached("access-control-expose-headers");
86      /**
87       * {@code "access-control-max-age"}
88       */
89      public static final AsciiString ACCESS_CONTROL_MAX_AGE = AsciiString.cached("access-control-max-age");
90      /**
91       * {@code "access-control-request-headers"}
92       */
93      public static final AsciiString ACCESS_CONTROL_REQUEST_HEADERS =
94              AsciiString.cached("access-control-request-headers");
95      /**
96       * {@code "access-control-request-method"}
97       */
98      public static final AsciiString ACCESS_CONTROL_REQUEST_METHOD =
99              AsciiString.cached("access-control-request-method");
100     /**
101      * {@code "access-control-request-private-network"}
102      */
103     public static final AsciiString ACCESS_CONTROL_REQUEST_PRIVATE_NETWORK =
104             AsciiString.cached("access-control-request-private-network");
105     /**
106      * {@code "age"}
107      */
108     public static final AsciiString AGE = AsciiString.cached("age");
109     /**
110      * {@code "allow"}
111      */
112     public static final AsciiString ALLOW = AsciiString.cached("allow");
113     /**
114      * {@code "authorization"}
115      */
116     public static final AsciiString AUTHORIZATION = AsciiString.cached("authorization");
117     /**
118      * {@code "cache-control"}
119      */
120     public static final AsciiString CACHE_CONTROL = AsciiString.cached("cache-control");
121     /**
122      * {@code "connection"}
123      */
124     public static final AsciiString CONNECTION = AsciiString.cached("connection");
125     /**
126      * {@code "content-base"}
127      */
128     public static final AsciiString CONTENT_BASE = AsciiString.cached("content-base");
129     /**
130      * {@code "content-encoding"}
131      */
132     public static final AsciiString CONTENT_ENCODING = AsciiString.cached("content-encoding");
133     /**
134      * {@code "content-language"}
135      */
136     public static final AsciiString CONTENT_LANGUAGE = AsciiString.cached("content-language");
137     /**
138      * {@code "content-length"}
139      */
140     public static final AsciiString CONTENT_LENGTH = AsciiString.cached("content-length");
141     /**
142      * {@code "content-location"}
143      */
144     public static final AsciiString CONTENT_LOCATION = AsciiString.cached("content-location");
145     /**
146      * {@code "content-transfer-encoding"}
147      */
148     public static final AsciiString CONTENT_TRANSFER_ENCODING = AsciiString.cached("content-transfer-encoding");
149     /**
150      * {@code "content-disposition"}
151      */
152     public static final AsciiString CONTENT_DISPOSITION = AsciiString.cached("content-disposition");
153     /**
154      * {@code "content-md5"}
155      */
156     public static final AsciiString CONTENT_MD5 = AsciiString.cached("content-md5");
157     /**
158      * {@code "content-range"}
159      */
160     public static final AsciiString CONTENT_RANGE = AsciiString.cached("content-range");
161     /**
162      * {@code "content-security-policy"}
163      */
164     public static final AsciiString CONTENT_SECURITY_POLICY = AsciiString.cached("content-security-policy");
165     /**
166      * {@code "content-type"}
167      */
168     public static final AsciiString CONTENT_TYPE = AsciiString.cached("content-type");
169     /**
170      * {@code "cookie"}
171      */
172     public static final AsciiString COOKIE = AsciiString.cached("cookie");
173     /**
174      * {@code "date"}
175      */
176     public static final AsciiString DATE = AsciiString.cached("date");
177     /**
178      * {@code "dnt"}
179      */
180     public static final AsciiString DNT = AsciiString.cached("dnt");
181     /**
182      * {@code "etag"}
183      */
184     public static final AsciiString ETAG = AsciiString.cached("etag");
185     /**
186      * {@code "expect"}
187      */
188     public static final AsciiString EXPECT = AsciiString.cached("expect");
189     /**
190      * {@code "expires"}
191      */
192     public static final AsciiString EXPIRES = AsciiString.cached("expires");
193     /**
194      * {@code "from"}
195      */
196     public static final AsciiString FROM = AsciiString.cached("from");
197     /**
198      * {@code "host"}
199      */
200     public static final AsciiString HOST = AsciiString.cached("host");
201     /**
202      * {@code "if-match"}
203      */
204     public static final AsciiString IF_MATCH = AsciiString.cached("if-match");
205     /**
206      * {@code "if-modified-since"}
207      */
208     public static final AsciiString IF_MODIFIED_SINCE = AsciiString.cached("if-modified-since");
209     /**
210      * {@code "if-none-match"}
211      */
212     public static final AsciiString IF_NONE_MATCH = AsciiString.cached("if-none-match");
213     /**
214      * {@code "if-range"}
215      */
216     public static final AsciiString IF_RANGE = AsciiString.cached("if-range");
217     /**
218      * {@code "if-unmodified-since"}
219      */
220     public static final AsciiString IF_UNMODIFIED_SINCE = AsciiString.cached("if-unmodified-since");
221     /**
222      * @deprecated use {@link #CONNECTION}
223      *
224      * {@code "keep-alive"}
225      */
226     @Deprecated
227     public static final AsciiString KEEP_ALIVE = AsciiString.cached("keep-alive");
228     /**
229      * {@code "last-modified"}
230      */
231     public static final AsciiString LAST_MODIFIED = AsciiString.cached("last-modified");
232     /**
233      * {@code "location"}
234      */
235     public static final AsciiString LOCATION = AsciiString.cached("location");
236     /**
237      * {@code "max-forwards"}
238      */
239     public static final AsciiString MAX_FORWARDS = AsciiString.cached("max-forwards");
240     /**
241      * {@code "origin"}
242      */
243     public static final AsciiString ORIGIN = AsciiString.cached("origin");
244     /**
245      * {@code "pragma"}
246      */
247     public static final AsciiString PRAGMA = AsciiString.cached("pragma");
248     /**
249      * {@code "proxy-authenticate"}
250      */
251     public static final AsciiString PROXY_AUTHENTICATE = AsciiString.cached("proxy-authenticate");
252     /**
253      * {@code "proxy-authorization"}
254      */
255     public static final AsciiString PROXY_AUTHORIZATION = AsciiString.cached("proxy-authorization");
256     /**
257      * @deprecated use {@link #CONNECTION}
258      *
259      * {@code "proxy-connection"}
260      */
261     @Deprecated
262     public static final AsciiString PROXY_CONNECTION = AsciiString.cached("proxy-connection");
263     /**
264      * {@code "range"}
265      */
266     public static final AsciiString RANGE = AsciiString.cached("range");
267     /**
268      * {@code "referer"}
269      */
270     public static final AsciiString REFERER = AsciiString.cached("referer");
271     /**
272      * {@code "retry-after"}
273      */
274     public static final AsciiString RETRY_AFTER = AsciiString.cached("retry-after");
275     /**
276      * {@code "sec-websocket-key1"}
277      */
278     public static final AsciiString SEC_WEBSOCKET_KEY1 = AsciiString.cached("sec-websocket-key1");
279     /**
280      * {@code "sec-websocket-key2"}
281      */
282     public static final AsciiString SEC_WEBSOCKET_KEY2 = AsciiString.cached("sec-websocket-key2");
283     /**
284      * {@code "sec-websocket-location"}
285      */
286     public static final AsciiString SEC_WEBSOCKET_LOCATION = AsciiString.cached("sec-websocket-location");
287     /**
288      * {@code "sec-websocket-origin"}
289      */
290     public static final AsciiString SEC_WEBSOCKET_ORIGIN = AsciiString.cached("sec-websocket-origin");
291     /**
292      * {@code "sec-websocket-protocol"}
293      */
294     public static final AsciiString SEC_WEBSOCKET_PROTOCOL = AsciiString.cached("sec-websocket-protocol");
295     /**
296      * {@code "sec-websocket-version"}
297      */
298     public static final AsciiString SEC_WEBSOCKET_VERSION = AsciiString.cached("sec-websocket-version");
299     /**
300      * {@code "sec-websocket-key"}
301      */
302     public static final AsciiString SEC_WEBSOCKET_KEY = AsciiString.cached("sec-websocket-key");
303     /**
304      * {@code "sec-websocket-accept"}
305      */
306     public static final AsciiString SEC_WEBSOCKET_ACCEPT = AsciiString.cached("sec-websocket-accept");
307     /**
308      * {@code "sec-websocket-protocol"}
309      */
310     public static final AsciiString SEC_WEBSOCKET_EXTENSIONS = AsciiString.cached("sec-websocket-extensions");
311     /**
312      * {@code "server"}
313      */
314     public static final AsciiString SERVER = AsciiString.cached("server");
315     /**
316      * {@code "set-cookie"}
317      */
318     public static final AsciiString SET_COOKIE = AsciiString.cached("set-cookie");
319     /**
320      * {@code "set-cookie2"}
321      */
322     public static final AsciiString SET_COOKIE2 = AsciiString.cached("set-cookie2");
323     /**
324      * {@code "te"}
325      */
326     public static final AsciiString TE = AsciiString.cached("te");
327     /**
328      * {@code "trailer"}
329      */
330     public static final AsciiString TRAILER = AsciiString.cached("trailer");
331     /**
332      * {@code "transfer-encoding"}
333      */
334     public static final AsciiString TRANSFER_ENCODING = AsciiString.cached("transfer-encoding");
335     /**
336      * {@code "upgrade"}
337      */
338     public static final AsciiString UPGRADE = AsciiString.cached("upgrade");
339     /**
340      * {@code "upgrade-insecure-requests"}
341      */
342     public static final AsciiString UPGRADE_INSECURE_REQUESTS = AsciiString.cached("upgrade-insecure-requests");
343     /**
344      * {@code "user-agent"}
345      */
346     public static final AsciiString USER_AGENT = AsciiString.cached("user-agent");
347     /**
348      * {@code "vary"}
349      */
350     public static final AsciiString VARY = AsciiString.cached("vary");
351     /**
352      * {@code "via"}
353      */
354     public static final AsciiString VIA = AsciiString.cached("via");
355     /**
356      * {@code "warning"}
357      */
358     public static final AsciiString WARNING = AsciiString.cached("warning");
359     /**
360      * {@code "websocket-location"}
361      */
362     public static final AsciiString WEBSOCKET_LOCATION = AsciiString.cached("websocket-location");
363     /**
364      * {@code "websocket-origin"}
365      */
366     public static final AsciiString WEBSOCKET_ORIGIN = AsciiString.cached("websocket-origin");
367     /**
368      * {@code "websocket-protocol"}
369      */
370     public static final AsciiString WEBSOCKET_PROTOCOL = AsciiString.cached("websocket-protocol");
371     /**
372      * {@code "www-authenticate"}
373      */
374     public static final AsciiString WWW_AUTHENTICATE = AsciiString.cached("www-authenticate");
375     /**
376      * {@code "x-frame-options"}
377      */
378     public static final AsciiString X_FRAME_OPTIONS = AsciiString.cached("x-frame-options");
379     /**
380      * {@code "x-requested-with"}
381      */
382     public static final AsciiString X_REQUESTED_WITH = AsciiString.cached("x-requested-with");
383 
384     /**
385      * {@code "alt-svc"}
386      */
387     public static final AsciiString ALT_SVC = AsciiString.cached("alt-svc");
388 
389     private HttpHeaderNames() { }
390 }