joshelser commented on a change in pull request #85: [CALCITE-2704] Avoid use
of ISO-8859-1 to parse request in JsonHandler
URL: https://github.com/apache/calcite-avatica/pull/85#discussion_r296305371
##########
File path:
server/src/main/java/org/apache/calcite/avatica/server/AvaticaJsonHandler.java
##########
@@ -106,14 +106,18 @@ public void handle(String target, Request baseRequest,
// Avoid a new buffer creation for every HTTP request
final UnsynchronizedBuffer buffer = threadLocalBuffer.get();
try (ServletInputStream inputStream = request.getInputStream()) {
- rawRequest = AvaticaUtils.readFully(inputStream, buffer);
+ byte[] bytes = AvaticaUtils.readFullyToBytes(inputStream, buffer);
+ String encoding = request.getCharacterEncoding();
+ if (encoding == null) {
+ encoding = "UTF-8";
Review comment:
> If we always want to use UTF-8 then we can even leave the code as is
Yeah, we don't need to let people provide something else. UTF-8 will be
sufficient to encode everything (afaik). Using some other encoding isn't worth
the hassle of us altering the protocol to allow users to tell us that they want
to use some other encoding :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services