[Django] #29576: Fix construction of HTTP_COOKIE value in base environ of test requests

6 views
Skip to first unread message

Django

unread,
Jul 18, 2018, 9:57:48 PM7/18/18
to django-...@googlegroups.com
#29576: Fix construction of HTTP_COOKIE value in base environ of test requests
-------------------------------------+-------------------------------------
Reporter: Thng Kai | Owner: Thng Kai Yuan
Yuan |
Type: Bug | Status: assigned
Component: Testing | Version: master
framework |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
The existing implementation wrongly constructs cookies into:
' sessionid=helloworld; Domain=None; expires=None; Max-Age=None; Path=/'

For the given example, this fix will correct the construction to be:
'sessionid=helloworld'

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

Django

unread,
Jul 18, 2018, 9:59:50 PM7/18/18
to django-...@googlegroups.com
#29576: Fix construction of HTTP_COOKIE value in base environ of test requests
-------------------------------------+-------------------------------------
Reporter: Thng Kai Yuan | Owner: Thng Kai

| Yuan
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Thng Kai Yuan:

Old description:

> The existing implementation wrongly constructs cookies into:
> ' sessionid=helloworld; Domain=None; expires=None; Max-Age=None; Path=/'
>
> For the given example, this fix will correct the construction to be:
> 'sessionid=helloworld'

New description:

The bug exists at:
https://github.com/django/django/blob/master/django/test/client.py#L280

This existing implementation wrongly constructs cookies into:


' sessionid=helloworld; Domain=None; expires=None; Max-Age=None; Path=/'

For the given example, a fix will correct the construction to be:
'sessionid=helloworld'

--

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

Django

unread,
Jul 18, 2018, 10:08:59 PM7/18/18
to django-...@googlegroups.com
#29576: HTTP_COOKIE value is wrongly constructed in test client

-------------------------------------+-------------------------------------
Reporter: Thng Kai Yuan | Owner: Thng Kai
| Yuan
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

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

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

Django

unread,
Jul 19, 2018, 11:24:01 AM7/19/18
to django-...@googlegroups.com
#29576: HTTP_COOKIE value is wrongly constructed in test client
-------------------------------------+-------------------------------------
Reporter: Thng Kai Yuan | Owner: Thng Kai
| Yuan
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_tests: 0 => 1
* stage: Unreviewed => Accepted


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

Django

unread,
Jul 20, 2018, 11:10:34 PM7/20/18
to django-...@googlegroups.com
#29576: HTTP_COOKIE value is wrongly constructed in test client
-----------------------------------+------------------------------------
Reporter: Thng Kai Yuan | Owner: oliver
Type: Bug | Status: assigned

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by oliver):

* owner: Thng Kai Yuan => oliver


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

Django

unread,
Jul 20, 2018, 11:52:59 PM7/20/18
to django-...@googlegroups.com
#29576: HTTP_COOKIE value is wrongly constructed in test client
-----------------------------------+------------------------------------
Reporter: Thng Kai Yuan | Owner: (none)
Type: Bug | Status: new

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by oliver):

* owner: oliver => (none)
* status: assigned => new


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

Django

unread,
Jul 21, 2018, 5:25:35 PM7/21/18
to django-...@googlegroups.com
#29576: HTTP_COOKIE value is wrongly constructed in test client
-------------------------------------+-------------------------------------
Reporter: Thng Kai Yuan | Owner: Thng Kai

| Yuan
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* needs_tests: 1 => 0


Comment:

Test added in new [https://github.com/django/django/pull/10212 PR].

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

Django

unread,
Jul 21, 2018, 6:35:38 PM7/21/18
to django-...@googlegroups.com
#29576: HTTP_COOKIE value is wrongly constructed in test client
-------------------------------------+-------------------------------------
Reporter: Thng Kai Yuan | Owner: Thng Kai
| Yuan
Type: Bug | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"71a739f3d752015504d455bf6f01e63a04d1a383" 71a739f3]:
{{{
#!CommitTicketReference repository=""
revision="71a739f3d752015504d455bf6f01e63a04d1a383"
Fixed #29576 -- Corrected the test client's HTTP_COOKIE header.
}}}

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

Reply all
Reply to author
Forward
0 new messages