Merge pull request #3966 from sergevanginderachter/uribug

Fix bug in uri where redirect check fails.
This commit is contained in:
James Cammarata 2013-09-05 22:03:42 -07:00
commit bb5e4f0673

View file

@ -261,7 +261,7 @@ def uri(module, url, dest, user, password, body, method, headers, redirects, soc
# and update dest with the new url filename # and update dest with the new url filename
except: except:
pass pass
if resp_redir['status'] in ["301", "302", "303", "307"]: if 'status' in resp_redir and resp_redir['status'] in ["301", "302", "303", "307"]:
url = resp_redir['location'] url = resp_redir['location']
redirected = True redirected = True
dest = os.path.join(dest, url_filename(url)) dest = os.path.join(dest, url_filename(url))