Handle domain name-only URL without trailing /
https://www.google.co.in fails. Surprisingly, http://www.google.com worked!
This commit is contained in:
parent
e800ae909a
commit
e39e2621d5
4
buku
4
buku
@ -205,6 +205,8 @@ def getPageResp(url, fullurl=False):
|
|||||||
if fullurl == False:
|
if fullurl == False:
|
||||||
url = server[marker:]
|
url = server[marker:]
|
||||||
server = server[:marker]
|
server = server[:marker]
|
||||||
|
else: # Handle domain name without trailing /
|
||||||
|
url = '/'
|
||||||
urlconn = HTTPSConnection(server, timeout=30)
|
urlconn = HTTPSConnection(server, timeout=30)
|
||||||
elif url.find("http://") >= 0: # Insecure connection
|
elif url.find("http://") >= 0: # Insecure connection
|
||||||
server = url[7:]
|
server = url[7:]
|
||||||
@ -213,6 +215,8 @@ def getPageResp(url, fullurl=False):
|
|||||||
if fullurl == False:
|
if fullurl == False:
|
||||||
url = server[marker:]
|
url = server[marker:]
|
||||||
server = server[:marker]
|
server = server[:marker]
|
||||||
|
else:
|
||||||
|
url = '/'
|
||||||
urlconn = HTTPConnection(server, timeout=30)
|
urlconn = HTTPConnection(server, timeout=30)
|
||||||
else:
|
else:
|
||||||
printmsg("Not a valid HTTP(S) url", "WARNING")
|
printmsg("Not a valid HTTP(S) url", "WARNING")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user