From c3ef6761a9bc58d2c4b155b1baca72d937e888c2 Mon Sep 17 00:00:00 2001 From: _Bastler Date: Thu, 18 Dec 2025 23:17:02 +0100 Subject: [PATCH] hopefully --- .../de/bstly/we/businesslogic/PretixManager.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/de/bstly/we/businesslogic/PretixManager.java b/core/src/main/java/de/bstly/we/businesslogic/PretixManager.java index 4201eb2..5d8f33d 100755 --- a/core/src/main/java/de/bstly/we/businesslogic/PretixManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/PretixManager.java @@ -490,9 +490,6 @@ public class PretixManager implements SmartInitializingSingleton { * @return the json element */ public JsonElement request(String path, HttpMethod method, MultiValueMap queryParameters) { - if (path.startsWith(host)) { - path = path.replace(host, ""); - } return request(path, method, null, queryParameters); } @@ -520,10 +517,19 @@ public class PretixManager implements SmartInitializingSingleton { public JsonElement request(String path, HttpMethod method, JsonElement payload, MultiValueMap queryParameters) { - logger.debug("method:" + method.toString() + ", path: " + path + ", host" + host); + String cleanedPath = path.replace(host, ""); + int queryIndex = cleanedPath.indexOf('?'); + if (queryIndex != -1) { + cleanedPath = cleanedPath.substring(0, queryIndex); + } + + logger.debug("method:" + method.toString() + ", path: " + path + ", cleaned path: " + cleanedPath + ", host: " + + host); + + final String finalPath = cleanedPath; WebClient.RequestBodySpec request = webClient.method(method) - .uri(uriBuilder -> uriBuilder.path(path).queryParams(queryParameters).build()); + .uri(uriBuilder -> uriBuilder.path(finalPath).queryParams(queryParameters).build()); if (payload != null) { request.bodyValue(gson.toJson(payload));