Closed waterkip closed 6 months ago
I'm going to close and re-open to see if that starts CI.
What about the following:
set the %StatusCodes like:
306 => '(Unused)', # RFC 9110: Previously used and reserved
418 => '(Unused)', # RFC 9110: Its official now -sorta
# 419 .. 420
my %compat = (
I_AM_A_TEAPOT => sub {
carp "HTTP Status Code 418 set to \"I'm a Teapot\"\n"
$StatusCode{418} = "I'm a teapot";
418
},
NO_CODE => \&HTTP_TOO_EARLY,
PAYLOAD_TOO_LARGE => \&HTTP_CONTENT_TOO_LARGE,
REQUEST_ENTITY_TOO_LARGE => \&HTTP_CONTENT_TOO_LARGE,
REQUEST_RANGE_NOT_SATISFIABLE => \&HTTP_RANGE_NOT_SATISFIABLE,
REQUEST_URI_TOO_LARGE => \&HTTP_URI_TOO_LONG,
UNPROCESSABLE_ENTITY => \&HTTP_UNPROCESSABLE_CONTENT,
UNORDERED_COLLECTION => \&HTTP_TOO_EARLY,
UNUSED => sub {
carp "HTTP Status Code '(Unused)'\n";
000
},
);
That way, for those who fancy the 🫖 , it is still there when once used as HTTP_I_AM_A_TEAPOT
. Maybe a nice way to only warn the user once for the teapot, and only set the status code message once ?
Please be advised, that use Carp
might be needed, and that whilst looping during '# create mnemonic subroutines
' it will redefine HTTP_UNUSED
.
Just some ideas...
I think it would be better to remove the constants for the "unused" codes. That eliminates the ambiguity between 306 and 418.
I think it would be better to remove the constants for the "unused" codes. That eliminates the ambiguity between 306 and 418.
I am totally fine with removing (or preferably not adding) the HTTP_UNUSED
and RC_UNUSED
.
But unlike non registered codes that will return undef
when calling status_message
for not registered codes, II think we should return (Unused)
for both 306
and 418
, for that is what is set to at the IANA registry.
Any update on this PR?
Close and re-open to kick off CI.
Thanks, @waterkip!
Reference: https://www.rfc-editor.org/rfc/rfc9110.html#name-changes-from-rfc-7231