Skip to content

Docs: correct HTTP 401 status text to "Unauthorized"#9961

Closed
Bojun-Vvibe wants to merge 1 commit intoencode:mainfrom
Bojun-Vvibe:agent/encode_django-rest-framework-1776703585
Closed

Docs: correct HTTP 401 status text to "Unauthorized"#9961
Bojun-Vvibe wants to merge 1 commit intoencode:mainfrom
Bojun-Vvibe:agent/encode_django-rest-framework-1776703585

Conversation

@Bojun-Vvibe
Copy link
Copy Markdown

Repo: encode/django-rest-framework (⭐ 28000)
Type: docs
Files changed: 1
Lines: +2/-2

What

The docs/api-guide/exceptions.md file described HTTP status code 401 as "401 Unauthenticated" in the API reference entries for AuthenticationFailed and NotAuthenticated. 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_UNAUTHORIZED in rest_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.

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.
@Bojun-Vvibe Bojun-Vvibe closed this by deleting the head repository Apr 21, 2026
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