mirror of
https://github.com/GNS3/gns3-registry.git
synced 2024-12-20 21:33:09 +00:00
use GET requests instead of HEAD for checking URLs
This commit is contained in:
parent
d4725259f4
commit
c4dcbe1567
@ -3,7 +3,7 @@
|
|||||||
"category": "guest",
|
"category": "guest",
|
||||||
"description": "Microsoft Windows (or simply Windows) is a graphical operating system developed, marketed, and sold by Microsoft.\n\nMicrosoft releases time limited VMs for testing Internet Explorer.\n\nOn the download site select the VM, as platform select VirtualBox, then download the zip file, afterwards unzip it.",
|
"description": "Microsoft Windows (or simply Windows) is a graphical operating system developed, marketed, and sold by Microsoft.\n\nMicrosoft releases time limited VMs for testing Internet Explorer.\n\nOn the download site select the VM, as platform select VirtualBox, then download the zip file, afterwards unzip it.",
|
||||||
"vendor_name": "Microsoft",
|
"vendor_name": "Microsoft",
|
||||||
"vendor_url": "https://dev.microsoft.com/",
|
"vendor_url": "http://www.microsoft.com",
|
||||||
"product_name": "Windows",
|
"product_name": "Windows",
|
||||||
"registry_version": 1,
|
"registry_version": 1,
|
||||||
"status": "experimental",
|
"status": "experimental",
|
||||||
|
@ -22,6 +22,11 @@ import pycurl
|
|||||||
|
|
||||||
err_list = []
|
err_list = []
|
||||||
|
|
||||||
|
|
||||||
|
def data_abort(data):
|
||||||
|
return -1
|
||||||
|
|
||||||
|
|
||||||
def check_url(url, appliance):
|
def check_url(url, appliance):
|
||||||
print(" " + url)
|
print(" " + url)
|
||||||
|
|
||||||
@ -30,15 +35,17 @@ def check_url(url, appliance):
|
|||||||
c = pycurl.Curl()
|
c = pycurl.Curl()
|
||||||
c.setopt(c.URL, url)
|
c.setopt(c.URL, url)
|
||||||
c.setopt(c.USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)')
|
c.setopt(c.USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)')
|
||||||
c.setopt(c.NOBODY, True)
|
|
||||||
c.setopt(c.FOLLOWLOCATION, True)
|
c.setopt(c.FOLLOWLOCATION, True)
|
||||||
|
c.setopt(c.WRITEFUNCTION, data_abort)
|
||||||
c.perform()
|
c.perform()
|
||||||
http_status = c.getinfo(c.RESPONSE_CODE)
|
http_status = c.getinfo(c.RESPONSE_CODE)
|
||||||
if http_status >= 400:
|
if http_status >= 400:
|
||||||
error = 'HTTP status {}'.format(http_status)
|
error = 'HTTP status {}'.format(http_status)
|
||||||
c.close()
|
c.close()
|
||||||
except pycurl.error:
|
except pycurl.error as err:
|
||||||
error = c.errstr()
|
errno, errstr = err.args
|
||||||
|
if errno != pycurl.E_WRITE_ERROR:
|
||||||
|
error = errstr
|
||||||
|
|
||||||
if error:
|
if error:
|
||||||
print(" " + error)
|
print(" " + error)
|
||||||
|
Loading…
Reference in New Issue
Block a user