From 034d1dbe0a90bd5805cba61a645e68495f36b2fb Mon Sep 17 00:00:00 2001 From: Florian Best Date: Fri, 27 Sep 2024 14:34:40 +0200 Subject: [PATCH] fix: fix login if password or username contains ":" --- src/gocept/collmex/collmex.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gocept/collmex/collmex.py b/src/gocept/collmex/collmex.py index 7f3d698..f933e00 100644 --- a/src/gocept/collmex/collmex.py +++ b/src/gocept/collmex/collmex.py @@ -319,7 +319,9 @@ def _post(self, data): data = (data.decode('UTF-8') if isinstance(data, bytes) else data) - data = 'LOGIN;{};{}\n'.format(self.username, self.password) + data + login = io.StringIO() + csv.writer(login, dialect=CollmexDialect).writerow(['LOGIN', self.username, self.password]) + data = login.getvalue() + data log.debug(data.replace(self.password, '')) content_type, body = gocept.collmex.utils.encode_multipart_formdata( [], [('fileName', 'api.csv', data)])