Skip to content

Commit

Permalink
Use utf-8 instead of default charset decoding azure functions requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nithanim authored and gsmet committed May 17, 2024
1 parent ec4f609 commit bfb73c7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -62,7 +63,7 @@ protected HttpResponseMessage nettyDispatch(HttpRequestMessage<Optional<String>>

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);
}

Expand Down

0 comments on commit bfb73c7

Please sign in to comment.