Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#32580 closed Cleanup/optimization (fixed)

Document that HttpRequest.get_host() can raise DisallowedHost

Reported by: Chris Jerdonek Owned by: SREEHARI K.V
Component: Documentation Version: 3.1
Severity: Normal Keywords: HttpRequest
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The Django docs currently don't mention that HttpRequest.get_host() can raise DisallowedHost:

docs: https://docs.djangoproject.com/en/3.1/ref/request-response/#django.http.HttpRequest.get_host

code: https://github.com/django/django/blob/41e6b2a3c5e723256506b9ff49437d52a1f3bf43/django/http/request.py#L130-L135

I think it would be helpful to mention that so people using the method can know to think about whether they need to handle that case.

Change History (5)

comment:1 by Mariusz Felisiak, 3 years ago

Component: HTTP handlingDocumentation
Triage Stage: UnreviewedAccepted

comment:2 by SREEHARI K.V, 3 years ago

Owner: changed from nobody to SREEHARI K.V
Status: newassigned

comment:3 by Mariusz Felisiak, 3 years ago

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:4 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In 0860db22:

Fixed #32580 -- Doc'd that HttpRequest.get_host() may raise DisallowedHost.

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In 5ebb8e6:

[3.2.x] Fixed #32580 -- Doc'd that HttpRequest.get_host() may raise DisallowedHost.

Backport of 0860db225a4a7059c0884c87c0a7aa0035fd0d36 from main

Note: See TracTickets for help on using tickets.
Back to Top