Merge 0.10->trunk
[prosody.git] / net / http / codes.lua
1
2 local response_codes = {
3         -- Source: http://www.iana.org/assignments/http-status-codes
4         -- s/^\(\d*\)\s*\(.*\S\)\s*\[RFC.*\]\s*$/^I["\1"] = "\2";
5         [100] = "Continue";
6         [101] = "Switching Protocols";
7         [102] = "Processing";
8
9         [200] = "OK";
10         [201] = "Created";
11         [202] = "Accepted";
12         [203] = "Non-Authoritative Information";
13         [204] = "No Content";
14         [205] = "Reset Content";
15         [206] = "Partial Content";
16         [207] = "Multi-Status";
17         [208] = "Already Reported";
18         [226] = "IM Used";
19
20         [300] = "Multiple Choices";
21         [301] = "Moved Permanently";
22         [302] = "Found";
23         [303] = "See Other";
24         [304] = "Not Modified";
25         [305] = "Use Proxy";
26         -- The 306 status code was used in a previous version of [RFC2616], is no longer used, and the code is reserved.
27         [307] = "Temporary Redirect";
28         [308] = "Permanent Redirect";
29
30         [400] = "Bad Request";
31         [401] = "Unauthorized";
32         [402] = "Payment Required";
33         [403] = "Forbidden";
34         [404] = "Not Found";
35         [405] = "Method Not Allowed";
36         [406] = "Not Acceptable";
37         [407] = "Proxy Authentication Required";
38         [408] = "Request Timeout";
39         [409] = "Conflict";
40         [410] = "Gone";
41         [411] = "Length Required";
42         [412] = "Precondition Failed";
43         [413] = "Payload Too Large";
44         [414] = "URI Too Long";
45         [415] = "Unsupported Media Type";
46         [416] = "Range Not Satisfiable";
47         [417] = "Expectation Failed";
48         [418] = "I'm a teapot";
49         [421] = "Misdirected Request";
50         [422] = "Unprocessable Entity";
51         [423] = "Locked";
52         [424] = "Failed Dependency";
53         -- The 425 status code is reserved for the WebDAV advanced collections expired proposal [RFC2817]
54         [426] = "Upgrade Required";
55         [428] = "Precondition Required";
56         [429] = "Too Many Requests";
57         [431] = "Request Header Fields Too Large";
58
59         [500] = "Internal Server Error";
60         [501] = "Not Implemented";
61         [502] = "Bad Gateway";
62         [503] = "Service Unavailable";
63         [504] = "Gateway Timeout";
64         [505] = "HTTP Version Not Supported";
65         [506] = "Variant Also Negotiates"; -- Experimental
66         [507] = "Insufficient Storage";
67         [508] = "Loop Detected";
68         [510] = "Not Extended";
69         [511] = "Network Authentication Required";
70 };
71
72 for k,v in pairs(response_codes) do response_codes[k] = k.." "..v; end
73 return setmetatable(response_codes, { __index = function(t, k) return k.." Unassigned"; end })