@@ -40,6 +40,7 @@ my %StatusCode = (
4040 303 => ' See Other' ,
4141 304 => ' Not Modified' , # RFC 7232: Conditional Request
4242 305 => ' Use Proxy' ,
43+ 306 => ' (Unused)' , # RFC 9110: Previously used and reserved
4344 307 => ' Temporary Redirect' ,
4445 308 => ' Permanent Redirect' , # RFC 7528: Permanent Redirect
4546# 309 .. 399
@@ -56,14 +57,15 @@ my %StatusCode = (
5657 410 => ' Gone' ,
5758 411 => ' Length Required' ,
5859 412 => ' Precondition Failed' , # RFC 7232: Conditional Request
59- 413 => ' Payload Too Large' ,
60+ 413 => ' Content Too Large' ,
6061 414 => ' URI Too Long' ,
6162 415 => ' Unsupported Media Type' ,
6263 416 => ' Range Not Satisfiable' , # RFC 7233: Range Requests
6364 417 => ' Expectation Failed' ,
64- # 418 .. 420
65+ 418 => " I'm a teapot" , # RFC 2324: RFC9110 reserved it
66+ # 419 .. 420
6567 421 => ' Misdirected Request' , # RFC 7540: HTTP/2
66- 422 => ' Unprocessable Entity ' , # RFC 4918 : WebDAV
68+ 422 => ' Unprocessable Content ' , # RFC 9110 : WebDAV
6769 423 => ' Locked' , # RFC 4918: WebDAV
6870 424 => ' Failed Dependency' , # RFC 4918: WebDAV
6971 425 => ' Too Early' , # RFC 8470: Using Early Data in HTTP
@@ -88,21 +90,17 @@ my %StatusCode = (
8890# 509
8991 510 => ' Not Extended' , # RFC 2774: Extension Framework
9092 511 => ' Network Authentication Required' , # RFC 6585: Additional Codes
91- );
92-
93- my %StatusCodeName ;
9493
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
9995 449 => ' Retry with' , # microsoft
10096 509 => ' Bandwidth Limit Exceeded' , # Apache / cPanel
10197);
10298
99+ my %StatusCodeName ;
103100my $mnemonicCode = ' ' ;
104101my ($code , $message );
105102while (($code , $message ) = each %StatusCode ) {
103+ next if $message eq ' (Unused)' ;
106104 # create mnemonic subroutines
107105 $message =~ s / I'm/ I am/ ;
108106 $message =~ tr / a-z \-/ A-Z__/ ;
@@ -121,7 +119,9 @@ die if $@;
121119push (@EXPORT , " RC_MOVED_TEMPORARILY" );
122120
123121my %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,
125125 REQUEST_URI_TOO_LARGE => \&HTTP_URI_TOO_LONG,
126126 REQUEST_RANGE_NOT_SATISFIABLE => \&HTTP_RANGE_NOT_SATISFIABLE,
127127 NO_CODE => \&HTTP_TOO_EARLY,
@@ -242,13 +242,13 @@ tag to import them all.
242242 HTTP_GONE (410)
243243 HTTP_LENGTH_REQUIRED (411)
244244 HTTP_PRECONDITION_FAILED (412)
245- HTTP_PAYLOAD_TOO_LARGE (413)
245+ HTTP_CONTENT_TOO_LARGE (413)
246246 HTTP_URI_TOO_LONG (414)
247247 HTTP_UNSUPPORTED_MEDIA_TYPE (415)
248248 HTTP_RANGE_NOT_SATISFIABLE (416)
249249 HTTP_EXPECTATION_FAILED (417)
250250 HTTP_MISDIRECTED REQUEST (421)
251- HTTP_UNPROCESSABLE_ENTITY (422)
251+ HTTP_UNPROCESSABLE_CONTENT (422)
252252 HTTP_LOCKED (423)
253253 HTTP_FAILED_DEPENDENCY (424)
254254 HTTP_TOO_EARLY (425)
0 commit comments