Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#12011 closed (fixed)

Test client ignores scheme on redirect

Reported by: Todd Gardner Owned by: nobody
Component: Testing framework Version: 1.1
Severity: Keywords: test client is_secure
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

While handling redirects, the test client ignores the scheme component of the redirect Location, which means the resulting redirect always have is_secure as False. This leads to problems when using a https redirect like http://www.djangosnippets.org/snippets/85/ (the test client will think it has gone into a redirect loop rather than arrive at the proper page). I've attached a patch which sets the scheme from Location if present.

Attachments (1)

test_client_redirect_scheme.diff (3.5 KB) - added by Todd Gardner 7 years ago.
Patch to the test client to consider Location scheme

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by Todd Gardner

Patch to the test client to consider Location scheme

comment:1 Changed 7 years ago by Russell Keith-Magee

milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:2 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [12419]) Fixed #12011 -- Modified the test client to preserve the request scheme on a redirect. Thanks to tgardner for the report and patch.

comment:3 Changed 7 years ago by Russell Keith-Magee

(In [12421]) [1.1.X] Fixed #12011 -- Modified the test client to preserve the request scheme on a redirect. Thanks to tgardner for the report and patch.

Backport of r12419 from trunk.

comment:4 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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