Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#12011 closed (fixed)

Test client ignores scheme on redirect

Reported by: tgardner 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 tgardner 6 years ago.
Patch to the test client to consider Location scheme

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by tgardner

Patch to the test client to consider Location scheme

comment:1 Changed 5 years ago by russellm

  • milestone set to 1.2
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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 5 years ago by russellm

(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 4 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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