[Django] #32580: Document that HttpRequest.get_host() can raise DisallowedHost

6 views
Skip to first unread message

Django

unread,
Mar 21, 2021, 10:22:21 AM3/21/21
to django-...@googlegroups.com
#32580: Document that HttpRequest.get_host() can raise DisallowedHost
-------------------------------------+-------------------------------------
Reporter: Chris | Owner: nobody
Jerdonek |
Type: | Status: new
Cleanup/optimization |
Component: HTTP | Version: 3.1
handling |
Severity: Normal | Keywords: HttpRequest
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/32580>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 22, 2021, 2:34:13 AM3/22/21
to django-...@googlegroups.com
#32580: Document that HttpRequest.get_host() can raise DisallowedHost
--------------------------------------+------------------------------------
Reporter: Chris Jerdonek | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 3.1
Severity: Normal | Resolution:
Keywords: HttpRequest | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* component: HTTP handling => Documentation
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/32580#comment:1>

Django

unread,
Mar 24, 2021, 12:18:41 PM3/24/21
to django-...@googlegroups.com
#32580: Document that HttpRequest.get_host() can raise DisallowedHost
-------------------------------------+-------------------------------------
Reporter: Chris Jerdonek | Owner:
Type: | sreehari1997
Cleanup/optimization | Status: assigned

Component: Documentation | Version: 3.1
Severity: Normal | Resolution:
Keywords: HttpRequest | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by sreehari1997):

* owner: nobody => sreehari1997
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/32580#comment:2>

Django

unread,
Mar 26, 2021, 2:37:49 AM3/26/21
to django-...@googlegroups.com
#32580: Document that HttpRequest.get_host() can raise DisallowedHost
-------------------------------------+-------------------------------------
Reporter: Chris Jerdonek | Owner: SREEHARI
Type: | K.V

Cleanup/optimization | Status: assigned
Component: Documentation | Version: 3.1
Severity: Normal | Resolution:
Keywords: HttpRequest | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 0 => 1
* stage: Accepted => Ready for checkin


Comment:

[https://github.com/django/django/pull/14181 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/32580#comment:3>

Django

unread,
Mar 26, 2021, 3:03:58 AM3/26/21
to django-...@googlegroups.com
#32580: Document that HttpRequest.get_host() can raise DisallowedHost
-------------------------------------+-------------------------------------
Reporter: Chris Jerdonek | Owner: SREEHARI
Type: | K.V
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1
Severity: Normal | Resolution: fixed

Keywords: HttpRequest | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"0860db225a4a7059c0884c87c0a7aa0035fd0d36" 0860db22]:
{{{
#!CommitTicketReference repository=""
revision="0860db225a4a7059c0884c87c0a7aa0035fd0d36"
Fixed #32580 -- Doc'd that HttpRequest.get_host() may raise
DisallowedHost.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32580#comment:4>

Django

unread,
Mar 26, 2021, 3:04:30 AM3/26/21
to django-...@googlegroups.com
#32580: Document that HttpRequest.get_host() can raise DisallowedHost
-------------------------------------+-------------------------------------
Reporter: Chris Jerdonek | Owner: SREEHARI
Type: | K.V
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1
Severity: Normal | Resolution: fixed
Keywords: HttpRequest | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"5ebb8e65dfddc70b0e91add0232fcb074006f571" 5ebb8e6]:
{{{
#!CommitTicketReference repository=""
revision="5ebb8e65dfddc70b0e91add0232fcb074006f571"
[3.2.x] Fixed #32580 -- Doc'd that HttpRequest.get_host() may raise
DisallowedHost.

Backport of 0860db225a4a7059c0884c87c0a7aa0035fd0d36 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32580#comment:5>

Reply all
Reply to author
Forward
0 new messages