Closed Grafcube closed 1 year ago
Good catch. Could you also include a link to the Mastodon regex as a comment for reference?
There might be a better way to handle this though because as far as I can tell, the spec says nothing about what values are acceptable for preferredUsername so there may be some usernames with '+' or '%' or something else.
The spec doesnt say a lot of things about the way things work in the real world. Taking it too literal would make things much more complicated for no benefit if no existing platform actually uses such possibilities.
Taking it too literal would make things much more complicated for no benefit if no existing platform actually uses such possibilities.
Fair enough. I have added a comment linking to the Mastodon source where the regex is from.
Thanks!
This PR changes the regex used for username in
extract_webfinger_name
to include additional characters like '.' and '-'. This is the same regex used in Mastodon.Some usernames may contain hyphens. The old regex made it impossible to get webfinger information for those usernames since it would always return an error.
There might be a better way to handle this though because as far as I can tell, the spec says nothing about what values are acceptable for
preferredUsername
so there may be some usernames with '+' or '%' or something else.