@@ -2908,7 +2908,7 @@ def redirect_request(self, req, fp, code, msg, headers, newurl):
2908
2908
"""
2909
2909
m = req .get_method ()
2910
2910
if (not (code in (301 , 302 , 303 , 307 , 308 ) and m in ("GET" , "HEAD" )
2911
- or code in (301 , 302 , 303 ) and m == "POST" )):
2911
+ or code in (301 , 302 , 303 ) and m == "POST" )):
2912
2912
raise compat_HTTPError (req .full_url , code , msg , headers , fp )
2913
2913
# Strictly (according to RFC 2616), 301 or 302 in response to
2914
2914
# a POST MUST NOT cause a redirection without confirmation
@@ -2930,11 +2930,10 @@ def redirect_request(self, req, fp, code, msg, headers, newurl):
2930
2930
CONTENT_HEADERS = ("content-length" , "content-type" )
2931
2931
# NB: don't use dict comprehension for python 2.6 compatibility
2932
2932
newheaders = dict ((k , v ) for k , v in req .headers .items ()
2933
- if k .lower () not in CONTENT_HEADERS )
2934
- return compat_urllib_request .Request (newurl ,
2935
- headers = newheaders ,
2936
- origin_req_host = req .origin_req_host ,
2937
- unverifiable = True )
2933
+ if k .lower () not in CONTENT_HEADERS )
2934
+ return compat_urllib_request .Request (
2935
+ newurl , headers = newheaders , origin_req_host = req .origin_req_host ,
2936
+ unverifiable = True )
2938
2937
2939
2938
2940
2939
def extract_timezone (date_str ):
0 commit comments