diff --git a/speedtest_cli.py b/speedtest_cli.py index be7726b..f1c8ac8 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -383,7 +383,11 @@ def getConfig(): response = uh.open(request) - text = gzip.GzipFile(fileobj=StringIO.StringIO(response.read())).read() + if (response.headers['content-encoding'] == 'gzip'): + text = gzip.GzipFile(fileobj=StringIO.StringIO(response.read())).read() + else: + text = response.read() + configxml = [] configxml.append(text)