[FIX] Поддержка пробелов в папках updates

This commit is contained in:
Gravit 2019-06-28 16:33:26 +07:00
parent b93c7d33eb
commit b408767343
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -9,6 +9,7 @@
import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.Client;
import pro.gravit.launchserver.websocket.json.SimpleResponse; import pro.gravit.launchserver.websocket.json.SimpleResponse;
import pro.gravit.utils.helper.IOHelper;
public class UpdateResponse extends SimpleResponse { public class UpdateResponse extends SimpleResponse {
public String dirName; public String dirName;
@ -38,7 +39,7 @@ public void execute(ChannelHandlerContext ctx, Client client) {
service.sendObject(ctx, new ErrorRequestEvent(String.format("Directory %s not found", dirName))); service.sendObject(ctx, new ErrorRequestEvent(String.format("Directory %s not found", dirName)));
return; return;
} }
String url = server.config.netty.downloadURL.replace("%dirname%", dirName); String url = server.config.netty.downloadURL.replace("%dirname%", IOHelper.urlEncode(dirName));
boolean zip = false; boolean zip = false;
if (server.config.netty.bindings.get(dirName) != null) { if (server.config.netty.bindings.get(dirName) != null) {
LaunchServer.NettyUpdatesBind bind = server.config.netty.bindings.get(dirName); LaunchServer.NettyUpdatesBind bind = server.config.netty.bindings.get(dirName);