🚧 Fixed bug

This commit is contained in:
Andreas Dinauer 2026-03-15 16:06:29 +01:00
parent 0bc2a63471
commit c7efe8f780

View File

@ -54,7 +54,7 @@ public class ProxyResource
}
@Route(path = "/*", order = 1)
public void proxy(@Context RoutingContext context)
public void proxy(@Context RoutingContext context, byte[] body)
{
List<String> requestSegments = Arrays.stream(context.request().path().split("/")).filter(item -> !StringUtils.isBlank(item)).toList();
@ -65,7 +65,7 @@ public class ProxyResource
LOG.info("Matched route with target '{}'", route.target());
try
{
HttpResponse<byte[]> response = forward(context.request().headers(), context.request().method(), route.strategy(), extractSession(context.request().cookies()), route.target(), concat(dropRoute(route.segments(), requestSegments)));
HttpResponse<byte[]> response = forward(context.request().headers(), context.request().method(), body, route.strategy(), extractSession(context.request().cookies()), route.target(), concat(dropRoute(route.segments(), requestSegments)));
ResponseHandler.success(context, response);
}
catch (Exception e)
@ -81,9 +81,9 @@ public class ProxyResource
}
}
public HttpResponse<byte[]> forward(MultiMap headers, HttpMethod method, String strategy, String auth, String forwardRoot, String forwardPath) throws IOException, InterruptedException
public HttpResponse<byte[]> forward(MultiMap headers, HttpMethod method, byte[] body, String strategy, String auth, String forwardRoot, String forwardPath) throws IOException, InterruptedException
{
HttpRequest.Builder builder = HttpRequest.newBuilder().method(method.name(), HttpRequest.BodyPublishers.noBody()).uri(URI.create(forwardRoot + "/" + forwardPath));
HttpRequest.Builder builder = HttpRequest.newBuilder().method(method.name(), HttpRequest.BodyPublishers.ofByteArray(body)).uri(URI.create(forwardRoot + "/" + forwardPath));
for (Map.Entry<String, String> entry : headers.entries())
{
try