Skip to content

Commit e43e198

Browse files
committed
Merge pull request #88 from brianjmiller/pr87
Fix broken basic auth with long username/password
2 parents a3fb50b + 42f4e83 commit e43e198

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tincan/remote_lrs.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ def __init__(self, *args, **kwargs):
7676
and "password" in kwargs \
7777
and kwargs["password"] is not None \
7878
and "auth" not in kwargs:
79-
# The base64 encode tacks on a \n character to the string which needs to be removed.
80-
auth_string = "Basic " + base64.encodestring(unicode(kwargs["username"]) +
81-
":" +
82-
unicode(kwargs["password"]))[:-1]
79+
auth_string = "Basic " + base64.b64encode(unicode(kwargs["username"]) +
80+
":" +
81+
unicode(kwargs["password"]))
8382

8483
kwargs.pop("username")
8584
kwargs.pop("password")

0 commit comments

Comments
 (0)