Software /
code /
prosody
Comparison
net/http/codes.lua @ 4631:fc5d3b053454
net.http.{server|codes|parser}: Initial commit.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 08 Apr 2012 04:09:33 +0500 |
child | 4723:198b11ed196a |
comparison
equal
deleted
inserted
replaced
4630:9502c0224caf | 4631:fc5d3b053454 |
---|---|
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 [422] = "Unprocessable Entity"; | |
48 [423] = "Locked"; | |
49 [424] = "Failed Dependency"; | |
50 -- The 425 status code is reserved for the WebDAV advanced collections expired proposal [RFC2817] | |
51 [426] = "Upgrade Required"; | |
52 | |
53 [500] = "Internal Server Error"; | |
54 [501] = "Not Implemented"; | |
55 [502] = "Bad Gateway"; | |
56 [503] = "Service Unavailable"; | |
57 [504] = "Gateway Timeout"; | |
58 [505] = "HTTP Version Not Supported"; | |
59 [506] = "Variant Also Negotiates"; -- Experimental | |
60 [507] = "Insufficient Storage"; | |
61 [508] = "Loop Detected"; | |
62 [510] = "Not Extended"; | |
63 }; | |
64 | |
65 for k,v in pairs(response_codes) do response_codes[k] = k.." "..v; end | |
66 return setmetatable(response_codes, { __index = function(t, k) return k.." Unassigned"; end }) |