KotRikD / tosu

Eponymous software for reading osu! memory, accounting for most of gosumemory's issues (not exactly)
https://tosu.app
GNU Lesser General Public License v3.0
108 stars 10 forks source link

Fix bug with retrieving beatmap data due to improper URL encoding #146

Closed thenerdie closed 2 months ago

thenerdie commented 2 months ago

I'm using tosu in a personal project of mine, and when I tried to access map data for certain songs, it was giving me a 404 error. Funny. As it turns out, such directory names contained URL reserved characters such as "#", and since the server was just running decodeURI() on the whole URL, it wasn't treating such reserved characters LITERALLY.

Take this directory name for example: 1032511 Hino Isuka - #be_fortunate

Obviously, the # is part of the song name, thus we want to treat it as a literal part of the resource name, instead of as a page locator tag. So I implemented encodeURIComponent() on each part of the URL, so that it would treat the # literally, encoding it as %23. :3

thenerdie commented 2 months ago

All requested changes should have been handled.

KotRikD commented 2 months ago

LGTM