Commit a2250584 by Daniel Hokka Zakrisson

Merge pull request #2298 from junegunn/get_url-force

get_url: should always download the file when force is set
parents 5ec40b17 7f556d89
......@@ -132,7 +132,7 @@ def url_do_get(module, url, dest):
request = urllib2.Request(url)
request.add_header('User-agent', USERAGENT)
if os.path.exists(dest):
if os.path.exists(dest) and not module.params['force']:
t = datetime.datetime.utcfromtimestamp(os.path.getmtime(dest))
tstamp = t.strftime('%a, %d %b %Y %H:%M:%S +0000')
request.add_header('If-Modified-Since', tstamp)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment