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

Have Launcher/Creator Tools/Etc handle URLs with spaces and other uncommon names correctly #223

Open
100chilly opened this issue Dec 12, 2017 · 9 comments
Labels

Comments

@100chilly
Copy link

I've noticed that trying to download mods with spaces or other symbols in the name result the client to error out.

Examples:
Botania r1.10-352.jar
Pam's HarvestCraft 1.12.2a.jar
BiblioCraft[v2.4.3][MC1.12.0].jar
The Beneath-1.12.2-1.3.0.jar
CreativeCore v1.9.12 mc1.12.2.jar
OnlinePicFrame v1.4.14 mc1.12.2.jar

Out of all my mods that download from curse, these 6 fail with

java.io.IOException: Did not get expected response code, got 404 for https://addons-origin.cursecdn.com
	at com.skcraft.launcher.util.HttpRequest.expectResponseCode(HttpRequest.java:169)
	at com.skcraft.launcher.install.HttpDownloader$HttpDownloadJob.download(HttpDownloader.java:252)
	at com.skcraft.launcher.install.HttpDownloader$HttpDownloadJob.download(HttpDownloader.java:229)
	at com.skcraft.launcher.install.HttpDownloader$HttpDownloadJob.run(HttpDownloader.java:202)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Ultimately if every Modder followed a set naming rule that removed spaces and symbols like [ | ] etc we wouldn't have any issues like this.

@100chilly
Copy link
Author

They work in a normal web browser but the client just seems to dislike the urls.

@spannerman79
Copy link

URLs can only be sent over the Internet using the ASCII character-set.

Many of modern days browsers step in and convert unsafe ASCII characters automatically - that is why they work in normal browsers.

For example the last one (OnlinePicFrame) URL becomes https://addons-origin.cursecdn.com/files/2500/607/OnlinePicFrame%20v1.4.14%20mc1.12.2.jar once URL encoded correctly.

@100chilly
Copy link
Author

@spannerman79 yeah I figured but we have the correct/safe url inputted into the url.txt but the launcher fails to download still. Any ideas why?

@spannerman79
Copy link

--2017-12-13 08:43:51--  https://addons-origin.cursecdn.com/files/2500/607/OnlinePicFrame%20v1.4.14%20mc1.12.2.jar
Resolving addons-origin.cursecdn.com (addons-origin.cursecdn.com)... 54.230.133.101
Connecting to addons-origin.cursecdn.com (addons-origin.cursecdn.com)|54.230.133.101|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 75639 (74K) [application/java-archive]
Saving to: ‘OnlinePicFrame v1.4.14 mc1.12.2.jar’

OnlinePicFrame v1.4.14  100%[=================================>]  73.87K  --.-KB/s   in 0.006s 

2017-12-13 08:43:52 (12.6 MB/s) - ‘OnlinePicFrame v1.4.14 mc1.12.2.jar’ saved [75639/75639]

That is the output of wget on my end - so the "unknown response" that is listed in your error needs to be found out yourself. I cannot do it as I get a http response of 200.

@sk89q
Copy link
Member

sk89q commented Dec 12, 2017

I'll check it out tonight if I don't forget.

@100chilly
Copy link
Author

@sk89q @spannerman79 Thank you both, I appreciate it. I'll keep an eye out for a reply. 😄

@spannerman79
Copy link

spannerman79 commented Feb 3, 2018

Another "launcher" has pointed out that the Curse platform does not use valid URLs according to RFC 3986, section 2.1 by including spaces and UTF-8 characters without percent encoding them.

So this is in fact a Curse issue (technically mod devs for the stupid as f* file naming as well as Curse for letting them get away with it)

@sk89q sk89q added the bug label Jul 15, 2018
@miiichael
Copy link

Another example: Round-Trees-5.0-§31.16.2-§o.zip

If I leave it as-is in url.txt, curse naturally complains about the non-ASCII characters in the URL with HTTP400. But if I try to escape the §'s myself, then my %'s get escaped, and 404s ensue.

So whatever is trying to url-escape the contents of url.txt files isn't doing it right (eg. it escapes % but not §). I don't think it's an issue with Curseforge using "wrong" URLs, or mod devs using "wrong" filenames.

@hedgehog1029
Copy link
Member

I think the problems on Curse's side that previously caused this issue have been cleaned up, and now there's a persistent issue on our side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants