Opened 15 years ago

Closed 15 years ago

Last modified 13 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: no UI/UX: no

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 15 years ago.
Patch to the test client to consider Location scheme

Download all attachments as: .zip

Change History (5)

by Todd Gardner, 15 years ago

Patch to the test client to consider Location scheme

comment:1 by Russell Keith-Magee, 15 years ago

milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:2 by Russell Keith-Magee, 15 years ago

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 by Russell Keith-Magee, 15 years ago

(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 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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