Docs: correct HTTP 401 status text to "Unauthorized"#9961
Closed
Bojun-Vvibe wants to merge 1 commit intoencode:mainfrom
Closed
Docs: correct HTTP 401 status text to "Unauthorized"#9961Bojun-Vvibe wants to merge 1 commit intoencode:mainfrom
Bojun-Vvibe wants to merge 1 commit intoencode:mainfrom
Conversation
The exceptions documentation referred to HTTP 401 as 'Unauthenticated', but RFC 7235 defines the official reason phrase for 401 as 'Unauthorized'. Update the AuthenticationFailed and NotAuthenticated descriptions to match the standard.
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.
Repo: encode/django-rest-framework (⭐ 28000)
Type: docs
Files changed: 1
Lines: +2/-2
What
The
docs/api-guide/exceptions.mdfile described HTTP status code 401 as "401 Unauthenticated" in the API reference entries forAuthenticationFailedandNotAuthenticated. This patch corrects both occurrences to "401 Unauthorized", matching the official IANA/RFC reason phrase.Why
RFC 7235 (and the IANA HTTP status code registry) defines the canonical reason phrase for 401 as "Unauthorized", not "Unauthenticated". DRF itself names the constant
HTTP_401_UNAUTHORIZEDinrest_framework/status.py, so the documentation was inconsistent both with the standard and with DRF's own code. Readers comparing the docs against the source or HTTP specs may be confused. No behavioral change; pure documentation fix.Testing
Documentation-only change — no code paths affected. Verified the surrounding context still reads correctly and that the "403 Forbidden" branch wording is unchanged. No build/test run required for a markdown edit.
Risk
Low — two-word docs fix, no code changes.