Vazkii / CMPDL

Curse Modpack Downloader
222 stars 58 forks source link

URL Encoding Problems #49

Closed zachdeibert closed 5 years ago

zachdeibert commented 6 years ago

This fixes issue #45 .

zachdeibert commented 6 years ago

This also fixes #41, #37, #35, and #34 .

zachdeibert commented 6 years ago

Actually, spaces in the URLs are still broken.

zachdeibert commented 6 years ago

There we go, now it works. :)

tomKPZ commented 6 years ago

@Vazkii any chance we can get this merged? Most modpacks fail to download because of this issue.

MrLavender commented 6 years ago

This does not fix the issue. There are still some mods that fail due to encoding (try downloading any pack that contains Better Builder's Wands, like Sevtech Ages).

The root problem is that encoding is being forced when it shouldn't be, and there is an easier way to solve that. The URI(String) constructor does not encode and will throw a URISyntaxException if the string isn't valid, so just try that first then only encode if it fails. See here.

I would submit a pull request but there doesn't seem to be much activity here lately...

So, in case it's useful to anyone, I have uploaded a fat jar build containing this fix here.