This commit is contained in:
Guilherme M. Prestes da Silva 2023-04-28 10:13:53 -03:00 committed by GitHub
commit 1181a17302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -62,9 +62,9 @@ setup(
'speedtest.net'),
long_description=long_description,
keywords='speedtest speedtest.net',
author='Matt Martz',
author_email='matt@sivel.net',
url='https://github.com/sivel/speedtest-cli',
author='Gmprestes',
author_email='gmprestes@gmail.com',
url='https://github.com/gmprestes/speedtest-cli',
license='Apache License, Version 2.0',
py_modules=['speedtest'],
entry_points={

View File

@ -698,6 +698,9 @@ def build_request(url, data=None, headers=None, bump='0', secure=False):
if not headers:
headers = {}
# DID YOU HEARD ABOUT 'THE' LORD?
if url[0] == ':':
scheme = ('http', 'https')[bool(secure)]
schemed_url = '%s%s' % (scheme, url)
@ -1348,6 +1351,13 @@ class Speedtest(object):
attrib['d'] = d
try:
url_final = attrib.get('url').replace(" ", "%20").rstrip()
attrib['url'] = url_final
except Exception:
continue
try:
self.servers[d].append(attrib)
except KeyError: