mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
Update check_url_redirect.py (#60991)
This commit is contained in:
@@ -5,9 +5,14 @@ import urllib2
|
||||
|
||||
|
||||
url = sys.argv[1]
|
||||
headers = {'User-Agent' : 'Mozilla'}
|
||||
if len(sys.argv) > 2:
|
||||
ua = sys.argv[2]
|
||||
headers = { 'User-Agent' : ua }
|
||||
|
||||
try:
|
||||
response = urllib2.urlopen(url)
|
||||
req = urllib2.Request(url, None, headers)
|
||||
response = urllib2.urlopen(req)
|
||||
redir = response.geturl()
|
||||
except Exception:
|
||||
import traceback
|
||||
|
||||
Reference in New Issue
Block a user