Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[weasyl] api-key authentication #1057

Merged
merged 3 commits into from
Oct 15, 2020
Merged

[weasyl] api-key authentication #1057

merged 3 commits into from
Oct 15, 2020

Conversation

Korvox
Copy link

@Korvox Korvox commented Oct 11, 2020

Fixes this comment

Required to download NSFW images.

@Korvox
Copy link
Author

Korvox commented Oct 11, 2020

Now I'm getting into it to actually see how usernames behave and I'm finding a whole lot of... edge cases? I just went down the front page looking for usernames with weird glyphs in them. Heres one with an underscore: https://www.weasyl.com/~anubiswerewolf. Its cut from every URL which is good and what we would hope would happen because we don't match on underscore. But heres one with dashes: https://www.weasyl.com/~thezombiecat. They get removed too, but we are matching on dashes. The API docs say a login name is:

"A user’s username, lowercase, and omitting all non-alphanumeric, non-ASCII characters."

Which doesn't actually hold as Importaste reported, the url names can contain tildes. Specifically ONLY on the userpages suffixed with a tilde. Everywhere else they are removed. It looks like pattern matching on dashes isn't necessary because Weasyl is formatting them out, as it does with underscores, but not with tildes.

What you can do, however, is add underscores and tildes. https://www.weasyl.com/~anubis_wer_ewo_lf is valid and won't redirect or update its url. You can get pretty wild with this: https://www.weasyl.com/~the-z@~o_!m-$.b%60|i(&e-*,c$a%5Et and it will STILL resolve. So Weasyl is back end filtering out nonalphanumerics from its requests when routing probably using the same sanitizer they use to generate owner_logins.

That seems to mean that we should be matching on anything but http control characters in the username, the only characters that seem to not work are #, %, /, and \.

@mikf mikf merged commit 3ec60e8 into mikf:master Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants