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