Fix POST 303 redirect resonse handling
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 31 Jan 2013 18:32:00 +0000 (10:32 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Thu, 31 Jan 2013 19:23:09 +0000 (11:23 -0800)
This fixes issue #1156.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
requests/sessions.py

index de3f5b7..c0840f2 100644 (file)
@@ -106,7 +106,7 @@ class SessionRedirectMixin(object):
                 url = urljoin(resp.url, requote_uri(url))
 
             # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4
-            if resp.status_code is codes.see_other and req.method != 'HEAD':
+            if resp.status_code == codes.see_other and req.method != 'HEAD':
                 method = 'GET'
 
             # Do what the browsers do, despite standards...