From 51f7ac82985ceeb7039d61ed60565743a1d38689 Mon Sep 17 00:00:00 2001 From: Yevheniy Oliynyk Date: Mon, 18 Nov 2024 20:23:27 +0100 Subject: [PATCH] fix query --- .../java/com/crowdin/cli/client/CrowdinProjectClient.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/crowdin/cli/client/CrowdinProjectClient.java b/src/main/java/com/crowdin/cli/client/CrowdinProjectClient.java index 66ca680d..2b31d637 100644 --- a/src/main/java/com/crowdin/cli/client/CrowdinProjectClient.java +++ b/src/main/java/com/crowdin/cli/client/CrowdinProjectClient.java @@ -27,6 +27,8 @@ import java.io.InputStream; import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.*; import java.util.function.BiPredicate; @@ -558,7 +560,8 @@ public void installApplication(String url) { @Override @SneakyThrows public Optional findManifestUrl(String id) { - var url = new URL("https://developer.app.crowdin.net/items/Item?filter={\"slug\":{\"_eq\":\"" + id + "\"}}&fields=manifest"); + var query = URLEncoder.encode( "{\"slug\":{\"_eq\":\"" + id + "\"}}", StandardCharsets.UTF_8); + var url = new URL("https://developer.app.crowdin.net/items/Item?filter=" + query + "&fields=manifest"); var res = new String(url.openStream().readAllBytes()); JSONObject json = new JSONObject(res); var apps = (JSONArray) json.get("data");