mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
Update check_url_redirect.cgi (#60990)
This commit is contained in:
@@ -5,8 +5,11 @@ import urllib2
|
||||
|
||||
form = cgi.FieldStorage()
|
||||
url = form.getvalue("url", "")
|
||||
ua = form.getvalue("user_agent", "Mozilla")
|
||||
try:
|
||||
response = urllib2.urlopen(url)
|
||||
headers = { 'User-Agent' : ua }
|
||||
req = urllib2.Request(url, None, headers)
|
||||
response = urllib2.urlopen(req)
|
||||
redir = response.geturl()
|
||||
except Exception:
|
||||
import traceback
|
||||
|
||||
Reference in New Issue
Block a user