@@ -40,6 +40,7 @@ my %StatusCode = (
40
40
303 => ' See Other' ,
41
41
304 => ' Not Modified' , # RFC 7232: Conditional Request
42
42
305 => ' Use Proxy' ,
43
+ 306 => ' (Unused)' , # RFC 9110: Previously used and reserved
43
44
307 => ' Temporary Redirect' ,
44
45
308 => ' Permanent Redirect' , # RFC 7528: Permanent Redirect
45
46
# 309 .. 399
@@ -56,14 +57,15 @@ my %StatusCode = (
56
57
410 => ' Gone' ,
57
58
411 => ' Length Required' ,
58
59
412 => ' Precondition Failed' , # RFC 7232: Conditional Request
59
- 413 => ' Payload Too Large' ,
60
+ 413 => ' Content Too Large' ,
60
61
414 => ' URI Too Long' ,
61
62
415 => ' Unsupported Media Type' ,
62
63
416 => ' Range Not Satisfiable' , # RFC 7233: Range Requests
63
64
417 => ' Expectation Failed' ,
64
- # 418 .. 420
65
+ 418 => " I'm a teapot" , # RFC 2324: RFC9110 reserved it
66
+ # 419 .. 420
65
67
421 => ' Misdirected Request' , # RFC 7540: HTTP/2
66
- 422 => ' Unprocessable Entity ' , # RFC 4918 : WebDAV
68
+ 422 => ' Unprocessable Content ' , # RFC 9110 : WebDAV
67
69
423 => ' Locked' , # RFC 4918: WebDAV
68
70
424 => ' Failed Dependency' , # RFC 4918: WebDAV
69
71
425 => ' Too Early' , # RFC 8470: Using Early Data in HTTP
@@ -88,21 +90,17 @@ my %StatusCode = (
88
90
# 509
89
91
510 => ' Not Extended' , # RFC 2774: Extension Framework
90
92
511 => ' Network Authentication Required' , # RFC 6585: Additional Codes
91
- );
92
-
93
- my %StatusCodeName ;
94
93
95
- # keep some unofficial codes that used to be in this distribution
96
- %StatusCode = (
97
- %StatusCode ,
98
- 418 => ' I\' m a teapot' , # RFC 2324: HTCPC/1.0 1-april
94
+ # Keep some unofficial codes that used to be in this distribution
99
95
449 => ' Retry with' , # microsoft
100
96
509 => ' Bandwidth Limit Exceeded' , # Apache / cPanel
101
97
);
102
98
99
+ my %StatusCodeName ;
103
100
my $mnemonicCode = ' ' ;
104
101
my ($code , $message );
105
102
while (($code , $message ) = each %StatusCode ) {
103
+ next if $message eq ' (Unused)' ;
106
104
# create mnemonic subroutines
107
105
$message =~ s / I'm/ I am/ ;
108
106
$message =~ tr / a-z \-/ A-Z__/ ;
@@ -121,7 +119,9 @@ die if $@;
121
119
push (@EXPORT , " RC_MOVED_TEMPORARILY" );
122
120
123
121
my %compat = (
124
- REQUEST_ENTITY_TOO_LARGE => \&HTTP_PAYLOAD_TOO_LARGE,
122
+ UNPROCESSABLE_ENTITY => \&HTTP_UNPROCESSABLE_CONTENT,
123
+ PAYLOAD_TOO_LARGE => \&HTTP_CONTENT_TOO_LARGE,
124
+ REQUEST_ENTITY_TOO_LARGE => \&HTTP_CONTENT_TOO_LARGE,
125
125
REQUEST_URI_TOO_LARGE => \&HTTP_URI_TOO_LONG,
126
126
REQUEST_RANGE_NOT_SATISFIABLE => \&HTTP_RANGE_NOT_SATISFIABLE,
127
127
NO_CODE => \&HTTP_TOO_EARLY,
@@ -242,13 +242,13 @@ tag to import them all.
242
242
HTTP_GONE (410)
243
243
HTTP_LENGTH_REQUIRED (411)
244
244
HTTP_PRECONDITION_FAILED (412)
245
- HTTP_PAYLOAD_TOO_LARGE (413)
245
+ HTTP_CONTENT_TOO_LARGE (413)
246
246
HTTP_URI_TOO_LONG (414)
247
247
HTTP_UNSUPPORTED_MEDIA_TYPE (415)
248
248
HTTP_RANGE_NOT_SATISFIABLE (416)
249
249
HTTP_EXPECTATION_FAILED (417)
250
250
HTTP_MISDIRECTED REQUEST (421)
251
- HTTP_UNPROCESSABLE_ENTITY (422)
251
+ HTTP_UNPROCESSABLE_CONTENT (422)
252
252
HTTP_LOCKED (423)
253
253
HTTP_FAILED_DEPENDENCY (424)
254
254
HTTP_TOO_EARLY (425)
0 commit comments