From 999987375cc02374c9d8fc8a854c29f0eb71f9c0 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 4 May 2020 14:39:47 +0100 Subject: [PATCH] Encode login details in ASCII --- aaisp-to-mqtt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aaisp-to-mqtt.py b/aaisp-to-mqtt.py index f29b820..8fd6e3f 100755 --- a/aaisp-to-mqtt.py +++ b/aaisp-to-mqtt.py @@ -12,7 +12,7 @@ import requests import argparse LOG = logging.getLogger(__name__) -VERSION = '0.2.2' +VERSION = '0.2.3' AAISP_INFO_URL = 'https://chaos2.aa.net.uk/broadband/info' @@ -57,8 +57,8 @@ def main(): # attempt to get details from aaisp LOG.info('Connecting to AAISP CHAOSv2 endpoint as %s/%s', aaisp_username, '*' * len(aaisp_password)) response = requests.get(AAISP_INFO_URL, params={ - 'control_login': aaisp_username, - 'control_password': aaisp_password + 'control_login': aaisp_username.encode('ascii'), + 'control_password': aaisp_password.encode('ascii') }) if not response.status_code == requests.codes.ok: LOG.error('Error connecting to AAISP CHAOSv2 endpoint: %s' % response.body)