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 committed May 15, 2024
1 parent 1eed729 commit 7b5217a
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 7b5217a

Please sign in to comment.