Cleanup the redirect if blocks.

This commit is contained in:
Cory Benfield
2013-11-24 11:13:49 +00:00
parent 470af31f4a
commit 3369d87da9
+2 -3
View File
@@ -113,13 +113,12 @@ class SessionRedirectMixin(object):
# Do what the browsers do, despite standards...
# First, turn 302s into GETs.
if (resp.status_code == codes.found and
method not in ('GET', 'HEAD')):
if resp.status_code == codes.found and method != 'HEAD':
method = 'GET'
# Second, if a POST is responded to with a 301, turn it into a GET.
# This bizarre behaviour is explained in Issue 1704.
if (resp.status_code == codes.moved) and (method == 'POST'):
if resp.status_code == codes.moved and method == 'POST':
method = 'GET'
prepared_request.method = method