From 942643df07c35b3290b5eaebcf8790a802441378 Mon Sep 17 00:00:00 2001 From: Nithanim Date: Fri, 23 Feb 2024 08:42:30 +0100 Subject: [PATCH] Use utf-8 instead of default charset decoding azure functions requests (cherry picked from commit bfb73c7415949f0e92b79b8c5b641cdf54b2ce0f) --- .../quarkus/azure/functions/resteasy/runtime/BaseFunction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/azure-functions-http/runtime/src/main/java/io/quarkus/azure/functions/resteasy/runtime/BaseFunction.java b/extensions/azure-functions-http/runtime/src/main/java/io/quarkus/azure/functions/resteasy/runtime/BaseFunction.java index 0f409fc01f076..9a3341f335e2a 100644 --- a/extensions/azure-functions-http/runtime/src/main/java/io/quarkus/azure/functions/resteasy/runtime/BaseFunction.java +++ b/extensions/azure-functions-http/runtime/src/main/java/io/quarkus/azure/functions/resteasy/runtime/BaseFunction.java @@ -3,6 +3,7 @@ import java.io.ByteArrayOutputStream; import java.nio.channels.Channels; import java.nio.channels.WritableByteChannel; +import java.nio.charset.StandardCharsets; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; @@ -62,7 +63,7 @@ protected HttpResponseMessage nettyDispatch(HttpRequestMessage> HttpContent requestContent = LastHttpContent.EMPTY_LAST_CONTENT; if (request.getBody().isPresent()) { - ByteBuf body = Unpooled.wrappedBuffer(request.getBody().get().getBytes()); + ByteBuf body = Unpooled.wrappedBuffer(request.getBody().get().getBytes(StandardCharsets.UTF_8)); requestContent = new DefaultLastHttpContent(body); }