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

FileNotFoundException if locally served filenames contain § #28

Closed paulhlschr closed 2 years ago

paulhlschr commented 2 years ago

This is reproducible and can be fixed by removing the § chars in the filenames.

java.io.FileNotFoundException: http://localhost:8080/resourcepacks/§6Chests-Reimagined§8-v1.3.zip
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
    at link.infra.packwiz.installer.request.handlers.RequestHandlerHTTP.getFileSource(RequestHandlerHTTP.kt:27)
    at link.infra.packwiz.installer.request.HandlerManager.getFileSource(HandlerManager.kt:43)
    at link.infra.packwiz.installer.metadata.IndexFile$File.getSource(IndexFile.kt:62)
    at link.infra.packwiz.installer.DownloadTask.download(DownloadTask.kt:225)
    at link.infra.packwiz.installer.UpdateManager.processIndex$lambda-14$lambda-13(UpdateManager.kt:355)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
comp500 commented 2 years ago

Duplicate of #5; paths are allowed to contain special characters but packwiz-installer doesn't encode them properly when converting them to URLs.