OLD | NEW |
| (Empty) |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "net/tools/flip_server/http_message_constants.h" | |
6 | |
7 namespace net { | |
8 | |
9 const char* get_http_status_message(int status_message) { | |
10 switch (status_message) { | |
11 case 100: | |
12 return "Continue"; | |
13 case 101: | |
14 return "Switching Protocols"; | |
15 case 200: | |
16 return "OK"; | |
17 case 201: | |
18 return "Created"; | |
19 case 202: | |
20 return "Accepted"; | |
21 case 203: | |
22 return "Non-Authoritative Information"; | |
23 case 204: | |
24 return "No Content"; | |
25 case 205: | |
26 return "Reset Content"; | |
27 case 206: | |
28 return "Partial Content"; | |
29 case 300: | |
30 return "Multiple Choices"; | |
31 case 301: | |
32 return "Moved Permanently"; | |
33 case 302: | |
34 return "Found"; | |
35 case 303: | |
36 return "See Other"; | |
37 case 304: | |
38 return "Not Modified"; | |
39 case 305: | |
40 return "Use Proxy"; | |
41 case 307: | |
42 return "Temporary Redirect"; | |
43 case 400: | |
44 return "Bad Request"; | |
45 case 401: | |
46 return "Unauthorized"; | |
47 case 402: | |
48 return "Payment Required"; | |
49 case 403: | |
50 return "Forbidden"; | |
51 case 404: | |
52 return "Not Found"; | |
53 case 405: | |
54 return "Method Not Allowed"; | |
55 case 406: | |
56 return "Not Acceptable"; | |
57 case 407: | |
58 return "Proxy Authentication Required"; | |
59 case 408: | |
60 return "Request Time-out"; | |
61 case 409: | |
62 return "Conflict"; | |
63 case 410: | |
64 return "Gone"; | |
65 case 411: | |
66 return "Length Required"; | |
67 case 412: | |
68 return "Precondition Failed"; | |
69 case 413: | |
70 return "Request Entity Too Large"; | |
71 case 414: | |
72 return "Request-URI Too Large"; | |
73 case 415: | |
74 return "Unsupported Media Type"; | |
75 case 416: | |
76 return "Requested range not satisfiable"; | |
77 case 417: | |
78 return "Expectation Failed"; | |
79 case 500: | |
80 return "Internal Server Error"; | |
81 case 501: | |
82 return "Not Implemented"; | |
83 case 502: | |
84 return "Bad Gateway"; | |
85 case 503: | |
86 return "Service Unavailable"; | |
87 case 504: | |
88 return "Gateway Time-out"; | |
89 case 505: | |
90 return "HTTP Version not supported"; | |
91 } | |
92 return "unknown"; | |
93 } | |
94 | |
95 const int http_status_codes[] = { | |
96 100, 101, 200, 201, 202, 203, 204, 205, 206, 300, 301, 302, 303, 304, | |
97 305, 307, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, | |
98 412, 413, 414, 415, 416, 417, 500, 501, 502, 503, 504, 505}; | |
99 | |
100 const int http_status_code_count = | |
101 sizeof(http_status_codes) / sizeof(http_status_codes[0]); | |
102 | |
103 } // namespace net | |
OLD | NEW |