hopefully
This commit is contained in:
@@ -490,9 +490,6 @@ public class PretixManager implements SmartInitializingSingleton {
|
|||||||
* @return the json element
|
* @return the json element
|
||||||
*/
|
*/
|
||||||
public JsonElement request(String path, HttpMethod method, MultiValueMap<String, String> queryParameters) {
|
public JsonElement request(String path, HttpMethod method, MultiValueMap<String, String> queryParameters) {
|
||||||
if (path.startsWith(host)) {
|
|
||||||
path = path.replace(host, "");
|
|
||||||
}
|
|
||||||
return request(path, method, null, queryParameters);
|
return request(path, method, null, queryParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,10 +517,19 @@ public class PretixManager implements SmartInitializingSingleton {
|
|||||||
public JsonElement request(String path, HttpMethod method, JsonElement payload,
|
public JsonElement request(String path, HttpMethod method, JsonElement payload,
|
||||||
MultiValueMap<String, String> queryParameters) {
|
MultiValueMap<String, String> 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)
|
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) {
|
if (payload != null) {
|
||||||
request.bodyValue(gson.toJson(payload));
|
request.bodyValue(gson.toJson(payload));
|
||||||
|
|||||||
Reference in New Issue
Block a user