1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-25 16:28:11 +00:00

Log error if you invalid character in auth login

Fix #1088
This commit is contained in:
Julien Duponchelle 2017-07-20 15:42:07 +02:00
parent b33ba5f8ea
commit 46e5e8ac68
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -129,7 +129,10 @@ class Compute:
self._user = user.strip()
if password:
self._password = password.strip()
self._auth = aiohttp.BasicAuth(self._user, self._password, "utf-8")
try:
self._auth = aiohttp.BasicAuth(self._user, self._password, "utf-8")
except ValueError as e:
log.error(str(e))
else:
self._password = None
self._auth = aiohttp.BasicAuth(self._user, "")
@ -665,4 +668,3 @@ class Compute:
return (this_interface["ip_address"], other_interface["ip_address"])
raise ValueError("No common subnet for compute {} and {}".format(self.name, other_compute.name))