Re: [Django] #34519: Don't send content in responses to HEAD requests

16 views
Skip to first unread message

Django

unread,
Apr 26, 2023, 11:44:59 AM4/26/23
to django-...@googlegroups.com
#34519: Don't send content in responses to HEAD requests
-------------------------------+--------------------------------------
Reporter: James Pic | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by David Sanders):

* status: new => closed
* resolution: => needsinfo


Comment:

Thanks for the report but it's not clear what issue you are reporting with
Django. Feel free to update the ticket with more context; closing for now
pending more information.

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

Django

unread,
Apr 26, 2023, 11:56:45 AM4/26/23
to django-...@googlegroups.com
#34519: Don't send content in responses to HEAD requests
-------------------------------+--------------------------------------
Reporter: James Pic | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by James Pic):

Do you want a description like this?

> Currently, Django sends content in responses to HEAD requests.
> Django MUST NOT send content in responses to HEAD requests, as per
RFC9110;
> The HEAD method is identical to GET except that the server MUST NOT send
content in the response.
> https://www.rfc-editor.org/rfc/rfc9110.html#name-head

Is that better or do you think we need more?

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

Django

unread,
Apr 26, 2023, 12:04:40 PM4/26/23
to django-...@googlegroups.com
#34519: Don't send content in responses to HEAD requests
-------------------------------+--------------------------------------
Reporter: James Pic | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by James Pic):

* Attachment "tcpdump.txt" added.


--
Ticket URL: <https://code.djangoproject.com/ticket/34519>

Django

unread,
Apr 26, 2023, 12:07:29 PM4/26/23
to django-...@googlegroups.com
#34519: Don't send content in responses to HEAD requests
-------------------------------+--------------------------------------
Reporter: James Pic | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Description changed by James Pic:

Old description:

> > 9.3.2. HEAD


> > The HEAD method is identical to GET except that the server MUST NOT
> send content in the response.
> https://www.rfc-editor.org/rfc/rfc9110.html#name-head

New description:

Responses to HEAD requests must not send content as per RFC9110

> 9.3.2. HEAD


> The HEAD method is identical to GET except that the server MUST NOT send
content in the response.

https://www.rfc-editor.org/rfc/rfc9110.html#name-head

Currently, Django sends content in response to HEAD requests.

Django *MUST NOT* send content in response for HEAD requests.

Demonstration:

{{{
$ django-admin startproject test
$ cd test && ./manage.py runserver
# tcpdump -vv -s0 -A -i lo port 8000 &> tcpdump.txt
$ curl -I localhost:8000
}}}

tcpdump.txt attached, it shows Django sends content in the HEAD response

--

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

Django

unread,
Apr 26, 2023, 12:10:42 PM4/26/23
to django-...@googlegroups.com
#34519: Don't send content in responses to HEAD requests
-------------------------------+--------------------------------------
Reporter: James Pic | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by James Pic):

Updated the description, I think it's now pretty understandable even with
little understanding of Django and HTTP ;)

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

Django

unread,
Apr 26, 2023, 12:11:51 PM4/26/23
to django-...@googlegroups.com
#34519: Don't send content in responses to HEAD requests
-------------------------------+--------------------------------------
Reporter: James Pic | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0

-------------------------------+--------------------------------------
Changes (by James Pic):

* easy: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/34519#comment:6>

Django

unread,
Apr 26, 2023, 12:17:37 PM4/26/23
to django-...@googlegroups.com
#34519: Don't send content in responses to HEAD requests
-------------------------------+--------------------------------------
Reporter: James Pic | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* resolution: needsinfo => duplicate


Comment:

Duplicate of #28054 (fixed in 8acc433e415cd771f69dfe84e57878a83641e78b).

--
Ticket URL: <https://code.djangoproject.com/ticket/34519#comment:7>

Django

unread,
Apr 26, 2023, 12:19:32 PM4/26/23
to django-...@googlegroups.com
#34519: Don't send content in responses to HEAD requests
-------------------------------+--------------------------------------
Reporter: James Pic | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by James Pic):

Thanks you very much!

--
Ticket URL: <https://code.djangoproject.com/ticket/34519#comment:8>

Reply all
Reply to author
Forward
0 new messages