Skip to content

Commit 86fc907

Browse files
committed
fix(mjpegclient): strip leading space from digest parameter keys
After splitting parameters key-value pairs by comma, they have a leading space. It remains as part of the key in the resulting dictionary, breaking `utils.build_digest_header()`. This change strips spaces from each key-value pair before creating the dictionary. Signed-off-by: MichaIng <micha@dietpi.com>
1 parent 3f90aee commit 86fc907

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

motioneye/mjpgclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def _on_www_authenticate(self, future: Future) -> None:
240240
if data.startswith('Digest'):
241241
logging.debug('mjpg client using digest authentication')
242242

243-
parts = data[7:].split(',')
243+
parts = [p.strip() for p in data[7:].split(',')]
244244
parts_dict = dict(p.split('=', 1) for p in parts)
245245
parts_dict = {p[0]: p[1].strip('"') for p in list(parts_dict.items())}
246246

0 commit comments

Comments
 (0)