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