use rpartition, not partition, to avoid splitting on leading @

This commit is contained in:
jesopo 2019-09-09 21:35:54 +01:00
parent 6d176a6aa1
commit a9d11fc7f8

View file

@ -10,7 +10,7 @@ ACTIVITY_HEADERS = {"Accept": ("application/ld+json; "
'profile="https://www.w3.org/ns/activitystreams"')} 'profile="https://www.w3.org/ns/activitystreams"')}
def _parse_username(s): def _parse_username(s):
username, _, instance = s.partition("@") username, _, instance = s.rpartition("@")
if username.startswith("@"): if username.startswith("@"):
username = username[1:] username = username[1:]
if username and instance: if username and instance: