packwiz / packwiz-installer

An installer for packwiz modpacks, with automatic auto-updating and optional mods! Works well with MultiMC and on servers.
https://packwiz.infra.link/
MIT License
51 stars 22 forks source link

Fixed problem with files containing special characters other than spaces #15

Closed geferon closed 2 years ago

geferon commented 2 years ago

There was an issue with special characters besides spaces, such as the square brackets and others. I just took a small class library from Apache HttpComponents Client (which is used specifically to encode and decode paths) and used it instead of replacing characters manually (and using URLEncoder or URLDecoder class, as these two will fuck up spaces and also forward slashes). I also changed the type of Download URL to URI, as they already have safe URLs.

comp500 commented 2 years ago

Thanks for the contribution, but I'm currently rewriting the backend code to not specify paths with URLs at all, and to use OkHttp's HttpUrl class for HTTP requests which is more lenient, so I've already fixed the issues this PR fixes.

geferon commented 2 years ago

Oh that's perfect then, although in a way I guess this could be considered as a quickfix? Either way, it's appreciated. Mind if I ask tho how long until we get the new update with the fixed issue?

comp500 commented 2 years ago

I'm not really sure how long it will take, it depends how much time I have free from doing other work.