eric6/WebBrowser/SafeBrowsing/SafeBrowsingUrl.py

changeset 7628
f904d0eef264
parent 7360
9190402e4505
child 7781
607a6098cb44
equal deleted inserted replaced
7626:7f643d41464e 7628:f904d0eef264
108 host = host.strip('.') 108 host = host.strip('.')
109 host = re.sub(r'\.+', '.', host).lower() 109 host = re.sub(r'\.+', '.', host).lower()
110 if host.isdigit(): 110 if host.isdigit():
111 try: 111 try:
112 host = socket.inet_ntoa(struct.pack("!I", int(host))) 112 host = socket.inet_ntoa(struct.pack("!I", int(host)))
113 except Exception: 113 except Exception: # secok
114 pass 114 pass
115 if host.startswith('0x') and '.' not in host: 115 if host.startswith('0x') and '.' not in host:
116 try: 116 try:
117 host = socket.inet_ntoa(struct.pack("!I", int(host, 16))) 117 host = socket.inet_ntoa(struct.pack("!I", int(host, 16)))
118 except Exception: 118 except Exception: # secok
119 pass 119 pass
120 quotedPath = quote(path) 120 quotedPath = quote(path)
121 quotedHost = quote(host) 121 quotedHost = quote(host)
122 if port is not None: 122 if port is not None:
123 quotedHost = '{0}:{1}'.format(quotedHost, port) 123 quotedHost = '{0}:{1}'.format(quotedHost, port)

eric ide

mercurial