net.server_event: Check the buffer *length*, not the buffer itself (Fixes 100% cpu...
[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
29         [400] = "Bad Request";
30         [401] = "Unauthorized";
31         [402] = "Payment Required";
32         [403] = "Forbidden";
33         [404] = "Not Found";
34         [405] = "Method Not Allowed";
35         [406] = "Not Acceptable";
36         [407] = "Proxy Authentication Required";
37         [408] = "Request Timeout";
38         [409] = "Conflict";
39         [410] = "Gone";
40         [411] = "Length Required";
41         [412] = "Precondition Failed";
42         [413] = "Request Entity Too Large";
43         [414] = "Request-URI Too Long";
44         [415] = "Unsupported Media Type";
45         [416] = "Requested Range Not Satisfiable";
46         [417] = "Expectation Failed";
47         [418] = "I'm a teapot";
48         [422] = "Unprocessable Entity";
49         [423] = "Locked";
50         [424] = "Failed Dependency";
51         -- The 425 status code is reserved for the WebDAV advanced collections expired proposal [RFC2817]
52         [426] = "Upgrade Required";
53
54         [500] = "Internal Server Error";
55         [501] = "Not Implemented";
56         [502] = "Bad Gateway";
57         [503] = "Service Unavailable";
58         [504] = "Gateway Timeout";
59         [505] = "HTTP Version Not Supported";
60         [506] = "Variant Also Negotiates"; -- Experimental
61         [507] = "Insufficient Storage";
62         [508] = "Loop Detected";
63         [510] = "Not Extended";
64 };
65
66 for k,v in pairs(response_codes) do response_codes[k] = k.." "..v; end
67 return setmetatable(response_codes, { __index = function(t, k) return k.." Unassigned"; end })