Handle domain name-only URL without trailing /

https://www.google.co.in fails.
Surprisingly, http://www.google.com worked!
This commit is contained in:
Arun Prakash Jana 2016-05-20 20:45:52 +05:30
parent e800ae909a
commit e39e2621d5
No known key found for this signature in database
GPG Key ID: C0A712ED95043DCB

4
buku
View File

@ -205,6 +205,8 @@ def getPageResp(url, fullurl=False):
if fullurl == False:
url = server[marker:]
server = server[:marker]
else: # Handle domain name without trailing /
url = '/'
urlconn = HTTPSConnection(server, timeout=30)
elif url.find("http://") >= 0: # Insecure connection
server = url[7:]
@ -213,6 +215,8 @@ def getPageResp(url, fullurl=False):
if fullurl == False:
url = server[marker:]
server = server[:marker]
else:
url = '/'
urlconn = HTTPConnection(server, timeout=30)
else:
printmsg("Not a valid HTTP(S) url", "WARNING")