providers inform wrong url server pathing that
This commit is contained in:
parent
214d996ced
commit
9b39cf97ec
13
speedtest.py
13
speedtest.py
|
|
@ -524,7 +524,7 @@ def _build_connection(connection, source_address, timeout, context=None):
|
||||||
"""
|
"""
|
||||||
def inner(host, **kwargs):
|
def inner(host, **kwargs):
|
||||||
kwargs.update({
|
kwargs.update({
|
||||||
'source_address': source_address.rstrip(),
|
'source_address': source_address,
|
||||||
'timeout': timeout
|
'timeout': timeout
|
||||||
})
|
})
|
||||||
if context:
|
if context:
|
||||||
|
|
@ -717,8 +717,6 @@ def build_request(url, data=None, headers=None, bump='0', secure=False):
|
||||||
int(timeit.time.time() * 1000),
|
int(timeit.time.time() * 1000),
|
||||||
bump)
|
bump)
|
||||||
|
|
||||||
final_url = final_url.rstrip()
|
|
||||||
|
|
||||||
headers.update({
|
headers.update({
|
||||||
'Cache-Control': 'no-cache',
|
'Cache-Control': 'no-cache',
|
||||||
})
|
})
|
||||||
|
|
@ -1353,6 +1351,13 @@ class Speedtest(object):
|
||||||
|
|
||||||
attrib['d'] = d
|
attrib['d'] = d
|
||||||
|
|
||||||
|
try:
|
||||||
|
url_final = attrib.get('url').replace(" ", "%20").rstrip()
|
||||||
|
attrib['url'] = url_final
|
||||||
|
except Exception:
|
||||||
|
continue
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.servers[d].append(attrib)
|
self.servers[d].append(attrib)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
@ -1462,7 +1467,7 @@ class Speedtest(object):
|
||||||
results = {}
|
results = {}
|
||||||
for server in servers:
|
for server in servers:
|
||||||
cum = []
|
cum = []
|
||||||
url = os.path.dirname(server['url'].rstrip())
|
url = os.path.dirname(server['url'])
|
||||||
stamp = int(timeit.time.time() * 1000)
|
stamp = int(timeit.time.time() * 1000)
|
||||||
latency_url = '%s/latency.txt?x=%s' % (url, stamp)
|
latency_url = '%s/latency.txt?x=%s' % (url, stamp)
|
||||||
for i in range(0, 3):
|
for i in range(0, 3):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue