Skip to content

Use the RFC 9110 reason phrases for 413, 414 and 416 - #1328

Merged
josevalim merged 1 commit into
elixir-plug:mainfrom
dylanpulver:rfc9110-status-reason-phrases
Sep 3, 2026
Merged

Use the RFC 9110 reason phrases for 413, 414 and 416#1328
josevalim merged 1 commit into
elixir-plug:mainfrom
dylanpulver:rfc9110-status-reason-phrases

Conversation

@dylanpulver

Copy link
Copy Markdown
Contributor

IANA's HTTP status code registry, and RFC 9110, name these differently:

code Plug registry / RFC 9110
413 Request Entity Too Large Content Too Large (§15.5.14)
414 Request-URI Too Long URI Too Long (§15.5.15)
416 Requested Range Not Satisfiable Range Not Satisfiable (§15.5.17)

RFC 9110 renamed four of the phrases Plug carries from RFC 7231. #1276 updated
422 and added the aliased_statuses mechanism 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_long and
:requested_range_not_satisfiable all keep working. What changes is the reason
phrase returned by reason_phrase/1 and 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 new
assertion; dropping the aliases fails the alias test, so both halves are needed.

Assisted by Claude (claude-opus-5); I reviewed and verified the change.

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>
@josevalim
josevalim merged commit 73404f8 into elixir-plug:main Sep 3, 2026
2 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants