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    *   http://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 "access-control-allow-credentials"}
54       */
55      public static final AsciiString ACCESS_CONTROL_ALLOW_CREDENTIALS =
56              AsciiString.cached("access-control-allow-credentials");
57      /**
58       * {@code "access-control-allow-headers"}
59       */
60      public static final AsciiString ACCESS_CONTROL_ALLOW_HEADERS =
61              AsciiString.cached("access-control-allow-headers");
62      /**
63       * {@code "access-control-allow-methods"}
64       */
65      public static final AsciiString ACCESS_CONTROL_ALLOW_METHODS =
66              AsciiString.cached("access-control-allow-methods");
67      /**
68       * {@code "access-control-allow-origin"}
69       */
70      public static final AsciiString ACCESS_CONTROL_ALLOW_ORIGIN =
71              AsciiString.cached("access-control-allow-origin");
72      /**
73       * {@code "access-control-expose-headers"}
74       */
75      public static final AsciiString ACCESS_CONTROL_EXPOSE_HEADERS =
76              AsciiString.cached("access-control-expose-headers");
77      /**
78       * {@code "access-control-max-age"}
79       */
80      public static final AsciiString ACCESS_CONTROL_MAX_AGE = AsciiString.cached("access-control-max-age");
81      /**
82       * {@code "access-control-request-headers"}
83       */
84      public static final AsciiString ACCESS_CONTROL_REQUEST_HEADERS =
85              AsciiString.cached("access-control-request-headers");
86      /**
87       * {@code "access-control-request-method"}
88       */
89      public static final AsciiString ACCESS_CONTROL_REQUEST_METHOD =
90              AsciiString.cached("access-control-request-method");
91      /**
92       * {@code "age"}
93       */
94      public static final AsciiString AGE = AsciiString.cached("age");
95      /**
96       * {@code "allow"}
97       */
98      public static final AsciiString ALLOW = AsciiString.cached("allow");
99      /**
100      * {@code "authorization"}
101      */
102     public static final AsciiString AUTHORIZATION = AsciiString.cached("authorization");
103     /**
104      * {@code "cache-control"}
105      */
106     public static final AsciiString CACHE_CONTROL = AsciiString.cached("cache-control");
107     /**
108      * {@code "connection"}
109      */
110     public static final AsciiString CONNECTION = AsciiString.cached("connection");
111     /**
112      * {@code "content-base"}
113      */
114     public static final AsciiString CONTENT_BASE = AsciiString.cached("content-base");
115     /**
116      * {@code "content-encoding"}
117      */
118     public static final AsciiString CONTENT_ENCODING = AsciiString.cached("content-encoding");
119     /**
120      * {@code "content-language"}
121      */
122     public static final AsciiString CONTENT_LANGUAGE = AsciiString.cached("content-language");
123     /**
124      * {@code "content-length"}
125      */
126     public static final AsciiString CONTENT_LENGTH = AsciiString.cached("content-length");
127     /**
128      * {@code "content-location"}
129      */
130     public static final AsciiString CONTENT_LOCATION = AsciiString.cached("content-location");
131     /**
132      * {@code "content-transfer-encoding"}
133      */
134     public static final AsciiString CONTENT_TRANSFER_ENCODING = AsciiString.cached("content-transfer-encoding");
135     /**
136      * {@code "content-disposition"}
137      */
138     public static final AsciiString CONTENT_DISPOSITION = AsciiString.cached("content-disposition");
139     /**
140      * {@code "content-md5"}
141      */
142     public static final AsciiString CONTENT_MD5 = AsciiString.cached("content-md5");
143     /**
144      * {@code "content-range"}
145      */
146     public static final AsciiString CONTENT_RANGE = AsciiString.cached("content-range");
147     /**
148      * {@code "content-security-policy"}
149      */
150     public static final AsciiString CONTENT_SECURITY_POLICY = AsciiString.cached("content-security-policy");
151     /**
152      * {@code "content-type"}
153      */
154     public static final AsciiString CONTENT_TYPE = AsciiString.cached("content-type");
155     /**
156      * {@code "cookie"}
157      */
158     public static final AsciiString COOKIE = AsciiString.cached("cookie");
159     /**
160      * {@code "date"}
161      */
162     public static final AsciiString DATE = AsciiString.cached("date");
163     /**
164      * {@code "etag"}
165      */
166     public static final AsciiString ETAG = AsciiString.cached("etag");
167     /**
168      * {@code "expect"}
169      */
170     public static final AsciiString EXPECT = AsciiString.cached("expect");
171     /**
172      * {@code "expires"}
173      */
174     public static final AsciiString EXPIRES = AsciiString.cached("expires");
175     /**
176      * {@code "from"}
177      */
178     public static final AsciiString FROM = AsciiString.cached("from");
179     /**
180      * {@code "host"}
181      */
182     public static final AsciiString HOST = AsciiString.cached("host");
183     /**
184      * {@code "if-match"}
185      */
186     public static final AsciiString IF_MATCH = AsciiString.cached("if-match");
187     /**
188      * {@code "if-modified-since"}
189      */
190     public static final AsciiString IF_MODIFIED_SINCE = AsciiString.cached("if-modified-since");
191     /**
192      * {@code "if-none-match"}
193      */
194     public static final AsciiString IF_NONE_MATCH = AsciiString.cached("if-none-match");
195     /**
196      * {@code "if-range"}
197      */
198     public static final AsciiString IF_RANGE = AsciiString.cached("if-range");
199     /**
200      * {@code "if-unmodified-since"}
201      */
202     public static final AsciiString IF_UNMODIFIED_SINCE = AsciiString.cached("if-unmodified-since");
203     /**
204      * @deprecated use {@link #CONNECTION}
205      *
206      * {@code "keep-alive"}
207      */
208     @Deprecated
209     public static final AsciiString KEEP_ALIVE = AsciiString.cached("keep-alive");
210     /**
211      * {@code "last-modified"}
212      */
213     public static final AsciiString LAST_MODIFIED = AsciiString.cached("last-modified");
214     /**
215      * {@code "location"}
216      */
217     public static final AsciiString LOCATION = AsciiString.cached("location");
218     /**
219      * {@code "max-forwards"}
220      */
221     public static final AsciiString MAX_FORWARDS = AsciiString.cached("max-forwards");
222     /**
223      * {@code "origin"}
224      */
225     public static final AsciiString ORIGIN = AsciiString.cached("origin");
226     /**
227      * {@code "pragma"}
228      */
229     public static final AsciiString PRAGMA = AsciiString.cached("pragma");
230     /**
231      * {@code "proxy-authenticate"}
232      */
233     public static final AsciiString PROXY_AUTHENTICATE = AsciiString.cached("proxy-authenticate");
234     /**
235      * {@code "proxy-authorization"}
236      */
237     public static final AsciiString PROXY_AUTHORIZATION = AsciiString.cached("proxy-authorization");
238     /**
239      * @deprecated use {@link #CONNECTION}
240      *
241      * {@code "proxy-connection"}
242      */
243     @Deprecated
244     public static final AsciiString PROXY_CONNECTION = AsciiString.cached("proxy-connection");
245     /**
246      * {@code "range"}
247      */
248     public static final AsciiString RANGE = AsciiString.cached("range");
249     /**
250      * {@code "referer"}
251      */
252     public static final AsciiString REFERER = AsciiString.cached("referer");
253     /**
254      * {@code "retry-after"}
255      */
256     public static final AsciiString RETRY_AFTER = AsciiString.cached("retry-after");
257     /**
258      * {@code "sec-websocket-key1"}
259      */
260     public static final AsciiString SEC_WEBSOCKET_KEY1 = AsciiString.cached("sec-websocket-key1");
261     /**
262      * {@code "sec-websocket-key2"}
263      */
264     public static final AsciiString SEC_WEBSOCKET_KEY2 = AsciiString.cached("sec-websocket-key2");
265     /**
266      * {@code "sec-websocket-location"}
267      */
268     public static final AsciiString SEC_WEBSOCKET_LOCATION = AsciiString.cached("sec-websocket-location");
269     /**
270      * {@code "sec-websocket-origin"}
271      */
272     public static final AsciiString SEC_WEBSOCKET_ORIGIN = AsciiString.cached("sec-websocket-origin");
273     /**
274      * {@code "sec-websocket-protocol"}
275      */
276     public static final AsciiString SEC_WEBSOCKET_PROTOCOL = AsciiString.cached("sec-websocket-protocol");
277     /**
278      * {@code "sec-websocket-version"}
279      */
280     public static final AsciiString SEC_WEBSOCKET_VERSION = AsciiString.cached("sec-websocket-version");
281     /**
282      * {@code "sec-websocket-key"}
283      */
284     public static final AsciiString SEC_WEBSOCKET_KEY = AsciiString.cached("sec-websocket-key");
285     /**
286      * {@code "sec-websocket-accept"}
287      */
288     public static final AsciiString SEC_WEBSOCKET_ACCEPT = AsciiString.cached("sec-websocket-accept");
289     /**
290      * {@code "sec-websocket-protocol"}
291      */
292     public static final AsciiString SEC_WEBSOCKET_EXTENSIONS = AsciiString.cached("sec-websocket-extensions");
293     /**
294      * {@code "server"}
295      */
296     public static final AsciiString SERVER = AsciiString.cached("server");
297     /**
298      * {@code "set-cookie"}
299      */
300     public static final AsciiString SET_COOKIE = AsciiString.cached("set-cookie");
301     /**
302      * {@code "set-cookie2"}
303      */
304     public static final AsciiString SET_COOKIE2 = AsciiString.cached("set-cookie2");
305     /**
306      * {@code "te"}
307      */
308     public static final AsciiString TE = AsciiString.cached("te");
309     /**
310      * {@code "trailer"}
311      */
312     public static final AsciiString TRAILER = AsciiString.cached("trailer");
313     /**
314      * {@code "transfer-encoding"}
315      */
316     public static final AsciiString TRANSFER_ENCODING = AsciiString.cached("transfer-encoding");
317     /**
318      * {@code "upgrade"}
319      */
320     public static final AsciiString UPGRADE = AsciiString.cached("upgrade");
321     /**
322      * {@code "user-agent"}
323      */
324     public static final AsciiString USER_AGENT = AsciiString.cached("user-agent");
325     /**
326      * {@code "vary"}
327      */
328     public static final AsciiString VARY = AsciiString.cached("vary");
329     /**
330      * {@code "via"}
331      */
332     public static final AsciiString VIA = AsciiString.cached("via");
333     /**
334      * {@code "warning"}
335      */
336     public static final AsciiString WARNING = AsciiString.cached("warning");
337     /**
338      * {@code "websocket-location"}
339      */
340     public static final AsciiString WEBSOCKET_LOCATION = AsciiString.cached("websocket-location");
341     /**
342      * {@code "websocket-origin"}
343      */
344     public static final AsciiString WEBSOCKET_ORIGIN = AsciiString.cached("websocket-origin");
345     /**
346      * {@code "websocket-protocol"}
347      */
348     public static final AsciiString WEBSOCKET_PROTOCOL = AsciiString.cached("websocket-protocol");
349     /**
350      * {@code "www-authenticate"}
351      */
352     public static final AsciiString WWW_AUTHENTICATE = AsciiString.cached("www-authenticate");
353     /**
354      * {@code "x-frame-options"}
355      */
356     public static final AsciiString X_FRAME_OPTIONS = AsciiString.cached("x-frame-options");
357 
358     private HttpHeaderNames() { }
359 }