Use the RFC 9110 reason phrases for 413, 414 and 416 - #1328
Merged
josevalim merged 1 commit intoSep 3, 2026
Conversation
IANA's HTTP status code registry lists these as "Content Too Large", "URI Too Long" and "Range Not Satisfiable". RFC 9110 renamed all four of the phrases Plug carried from RFC 7231; 422 was updated in elixir-plug#1276 and these three were left behind. The old atoms are kept as aliases, using the same mechanism elixir-plug#1276 added, so put_status(:request_entity_too_large) keeps working. Co-authored-by: Claude <noreply@anthropic.com>
Member
|
💚 💙 💜 💛 ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IANA's HTTP status code registry, and RFC 9110, name these differently:
RFC 9110 renamed four of the phrases Plug carries from RFC 7231. #1276 updated
422 and added the
aliased_statusesmechanism so the old atom kept resolving;these three were left on the old names.
This applies that same change to them and reuses that mechanism, so
put_status(:request_entity_too_large),:request_uri_too_longand:requested_range_not_satisfiableall keep working. What changes is the reasonphrase returned by
reason_phrase/1and the new atoms in the generated list.306 and 418 are also "(Unused)" in the registry, but they are historical and
load-bearing in Plug's own tests, so they are deliberately untouched.
mix test: 689 passed before, 689 after. Keeping the old phrases fails the newassertion; dropping the aliases fails the alias test, so both halves are needed.
Assisted by Claude (
claude-opus-5); I reviewed and verified the change.