Skip to content

Commit

Permalink
Merge pull request #40673 from Nithanim-Work/issue-36973-main
Browse files Browse the repository at this point in the history
Azure Functions HTTP: use utf-8 instead of default charset decoding request
  • Loading branch information
gsmet authored May 17, 2024
2 parents d77ee69 + bfb73c7 commit 1b085b9
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 1b085b9

Please sign in to comment.