Comparison

net/http/codes.lua @ 12802:4a8740e01813

Merge 0.12->trunk
author Kim Alvefur <zash@zash.se>
date Mon, 12 Dec 2022 07:10:54 +0100
parent 12548:5133d6e48686
comparison
equal deleted inserted replaced
12801:ebd6b4d8bf04 12802:4a8740e01813
1 1
2 local response_codes = { 2 local response_codes = {
3 -- Source: http://www.iana.org/assignments/http-status-codes 3 -- Source: http://www.iana.org/assignments/http-status-codes
4 4
5 [100] = "Continue"; -- RFC7231, Section 6.2.1 5 [100] = "Continue"; -- RFC9110, Section 15.2.1
6 [101] = "Switching Protocols"; -- RFC7231, Section 6.2.2 6 [101] = "Switching Protocols"; -- RFC9110, Section 15.2.2
7 [102] = "Processing"; 7 [102] = "Processing";
8 [103] = "Early Hints"; 8 [103] = "Early Hints";
9 -- [104-199] = "Unassigned"; 9 -- [104-199] = "Unassigned";
10 10
11 [200] = "OK"; -- RFC7231, Section 6.3.1 11 [200] = "OK"; -- RFC9110, Section 15.3.1
12 [201] = "Created"; -- RFC7231, Section 6.3.2 12 [201] = "Created"; -- RFC9110, Section 15.3.2
13 [202] = "Accepted"; -- RFC7231, Section 6.3.3 13 [202] = "Accepted"; -- RFC9110, Section 15.3.3
14 [203] = "Non-Authoritative Information"; -- RFC7231, Section 6.3.4 14 [203] = "Non-Authoritative Information"; -- RFC9110, Section 15.3.4
15 [204] = "No Content"; -- RFC7231, Section 6.3.5 15 [204] = "No Content"; -- RFC9110, Section 15.3.5
16 [205] = "Reset Content"; -- RFC7231, Section 6.3.6 16 [205] = "Reset Content"; -- RFC9110, Section 15.3.6
17 [206] = "Partial Content"; -- RFC7233, Section 4.1 17 [206] = "Partial Content"; -- RFC9110, Section 15.3.7
18 [207] = "Multi-Status"; 18 [207] = "Multi-Status";
19 [208] = "Already Reported"; 19 [208] = "Already Reported";
20 -- [209-225] = "Unassigned"; 20 -- [209-225] = "Unassigned";
21 [226] = "IM Used"; 21 [226] = "IM Used";
22 -- [227-299] = "Unassigned"; 22 -- [227-299] = "Unassigned";
23 23
24 [300] = "Multiple Choices"; -- RFC7231, Section 6.4.1 24 [300] = "Multiple Choices"; -- RFC9110, Section 15.4.1
25 [301] = "Moved Permanently"; -- RFC7231, Section 6.4.2 25 [301] = "Moved Permanently"; -- RFC9110, Section 15.4.2
26 [302] = "Found"; -- RFC7231, Section 6.4.3 26 [302] = "Found"; -- RFC9110, Section 15.4.3
27 [303] = "See Other"; -- RFC7231, Section 6.4.4 27 [303] = "See Other"; -- RFC9110, Section 15.4.4
28 [304] = "Not Modified"; -- RFC7232, Section 4.1 28 [304] = "Not Modified"; -- RFC9110, Section 15.4.5
29 [305] = "Use Proxy"; -- RFC7231, Section 6.4.5 29 [305] = "Use Proxy"; -- RFC9110, Section 15.4.6
30 -- [306] = "(Unused)"; -- RFC7231, Section 6.4.6 30 -- [306] = "(Unused)"; -- RFC9110, Section 15.4.7
31 [307] = "Temporary Redirect"; -- RFC7231, Section 6.4.7 31 [307] = "Temporary Redirect"; -- RFC9110, Section 15.4.8
32 [308] = "Permanent Redirect"; 32 [308] = "Permanent Redirect"; -- RFC9110, Section 15.4.9
33 -- [309-399] = "Unassigned"; 33 -- [309-399] = "Unassigned";
34 34
35 [400] = "Bad Request"; -- RFC7231, Section 6.5.1 35 [400] = "Bad Request"; -- RFC9110, Section 15.5.1
36 [401] = "Unauthorized"; -- RFC7235, Section 3.1 36 [401] = "Unauthorized"; -- RFC9110, Section 15.5.2
37 [402] = "Payment Required"; -- RFC7231, Section 6.5.2 37 [402] = "Payment Required"; -- RFC9110, Section 15.5.3
38 [403] = "Forbidden"; -- RFC7231, Section 6.5.3 38 [403] = "Forbidden"; -- RFC9110, Section 15.5.4
39 [404] = "Not Found"; -- RFC7231, Section 6.5.4 39 [404] = "Not Found"; -- RFC9110, Section 15.5.5
40 [405] = "Method Not Allowed"; -- RFC7231, Section 6.5.5 40 [405] = "Method Not Allowed"; -- RFC9110, Section 15.5.6
41 [406] = "Not Acceptable"; -- RFC7231, Section 6.5.6 41 [406] = "Not Acceptable"; -- RFC9110, Section 15.5.7
42 [407] = "Proxy Authentication Required"; -- RFC7235, Section 3.2 42 [407] = "Proxy Authentication Required"; -- RFC9110, Section 15.5.8
43 [408] = "Request Timeout"; -- RFC7231, Section 6.5.7 43 [408] = "Request Timeout"; -- RFC9110, Section 15.5.9
44 [409] = "Conflict"; -- RFC7231, Section 6.5.8 44 [409] = "Conflict"; -- RFC9110, Section 15.5.10
45 [410] = "Gone"; -- RFC7231, Section 6.5.9 45 [410] = "Gone"; -- RFC9110, Section 15.5.11
46 [411] = "Length Required"; -- RFC7231, Section 6.5.10 46 [411] = "Length Required"; -- RFC9110, Section 15.5.12
47 [412] = "Precondition Failed"; -- RFC7232, Section 4.2 47 [412] = "Precondition Failed"; -- RFC9110, Section 15.5.13
48 [413] = "Payload Too Large"; -- RFC7231, Section 6.5.11 48 [413] = "Content Too Large"; -- RFC9110, Section 15.5.14
49 [414] = "URI Too Long"; -- RFC7231, Section 6.5.12 49 [414] = "URI Too Long"; -- RFC9110, Section 15.5.15
50 [415] = "Unsupported Media Type"; -- RFC7231, Section 6.5.13 50 [415] = "Unsupported Media Type"; -- RFC9110, Section 15.5.16
51 [416] = "Range Not Satisfiable"; -- RFC7233, Section 4.4 51 [416] = "Range Not Satisfiable"; -- RFC9110, Section 15.5.17
52 [417] = "Expectation Failed"; -- RFC7231, Section 6.5.14 52 [417] = "Expectation Failed"; -- RFC9110, Section 15.5.18
53 [418] = "I'm a teapot"; -- RFC2324, Section 2.3.2 53 [418] = "I'm a teapot"; -- RFC2324, Section 2.3.2
54 -- [419-420] = "Unassigned"; 54 -- [419-420] = "Unassigned";
55 [421] = "Misdirected Request"; -- RFC7540, Section 9.1.2 55 [421] = "Misdirected Request"; -- RFC9110, Section 15.5.20
56 [422] = "Unprocessable Entity"; 56 [422] = "Unprocessable Content"; -- RFC9110, Section 15.5.21
57 [423] = "Locked"; 57 [423] = "Locked";
58 [424] = "Failed Dependency"; 58 [424] = "Failed Dependency";
59 [425] = "Too Early"; 59 [425] = "Too Early";
60 [426] = "Upgrade Required"; -- RFC7231, Section 6.5.15 60 [426] = "Upgrade Required"; -- RFC9110, Section 15.5.22
61 -- [427] = "Unassigned"; 61 -- [427] = "Unassigned";
62 [428] = "Precondition Required"; 62 [428] = "Precondition Required";
63 [429] = "Too Many Requests"; 63 [429] = "Too Many Requests";
64 -- [430] = "Unassigned"; 64 -- [430] = "Unassigned";
65 [431] = "Request Header Fields Too Large"; 65 [431] = "Request Header Fields Too Large";
66 -- [432-450] = "Unassigned"; 66 -- [432-450] = "Unassigned";
67 [451] = "Unavailable For Legal Reasons"; 67 [451] = "Unavailable For Legal Reasons";
68 -- [452-499] = "Unassigned"; 68 -- [452-499] = "Unassigned";
69 69
70 [500] = "Internal Server Error"; -- RFC7231, Section 6.6.1 70 [500] = "Internal Server Error"; -- RFC9110, Section 15.6.1
71 [501] = "Not Implemented"; -- RFC7231, Section 6.6.2 71 [501] = "Not Implemented"; -- RFC9110, Section 15.6.2
72 [502] = "Bad Gateway"; -- RFC7231, Section 6.6.3 72 [502] = "Bad Gateway"; -- RFC9110, Section 15.6.3
73 [503] = "Service Unavailable"; -- RFC7231, Section 6.6.4 73 [503] = "Service Unavailable"; -- RFC9110, Section 15.6.4
74 [504] = "Gateway Timeout"; -- RFC7231, Section 6.6.5 74 [504] = "Gateway Timeout"; -- RFC9110, Section 15.6.5
75 [505] = "HTTP Version Not Supported"; -- RFC7231, Section 6.6.6 75 [505] = "HTTP Version Not Supported"; -- RFC9110, Section 15.6.6
76 [506] = "Variant Also Negotiates"; 76 [506] = "Variant Also Negotiates";
77 [507] = "Insufficient Storage"; 77 [507] = "Insufficient Storage";
78 [508] = "Loop Detected"; 78 [508] = "Loop Detected";
79 -- [509] = "Unassigned"; 79 -- [509] = "Unassigned";
80 [510] = "Not Extended"; 80 [510] = "Not Extended"; -- (OBSOLETED)
81 [511] = "Network Authentication Required"; 81 [511] = "Network Authentication Required";
82 -- [512-599] = "Unassigned"; 82 -- [512-599] = "Unassigned";
83 }; 83 };
84 84
85 for k,v in pairs(response_codes) do response_codes[k] = ("%03d %s"):format(k, v); end 85 for k,v in pairs(response_codes) do response_codes[k] = ("%03d %s"):format(k, v); end