Skip to content

Commit

Permalink
Merge pull request #21734 from geoand/lambda-polish
Browse files Browse the repository at this point in the history
Polish LambdaHttpHandler instances
  • Loading branch information
geoand authored Nov 26, 2021
2 parents 3198006 + 972132a commit 477b090
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class LambdaHttpHandler implements RequestHandler<APIGatewayV2HTTPEvent,

private static final int BUFFER_SIZE = 8096;

private static Headers errorHeaders = new Headers();
private static final Headers errorHeaders = new Headers();
static {
errorHeaders.putSingle("Content-Type", "application/json");
}
Expand Down Expand Up @@ -139,7 +139,7 @@ public void handleMessage(Object msg) {
responseBuilder.setIsBase64Encoded(true);
responseBuilder.setBody(Base64.getEncoder().encodeToString(baos.toByteArray()));
} else {
responseBuilder.setBody(new String(baos.toByteArray(), StandardCharsets.UTF_8));
responseBuilder.setBody(baos.toString(StandardCharsets.UTF_8));
}
}
future.complete(responseBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class LambdaHttpHandler implements RequestHandler<AwsProxyRequest, AwsPro

private static final int BUFFER_SIZE = 8096;

private static Headers errorHeaders = new Headers();
private static final Headers errorHeaders = new Headers();
static {
errorHeaders.putSingle("Content-Type", "application/json");
}
Expand Down Expand Up @@ -126,7 +126,7 @@ public void handleMessage(Object msg) {
responseBuilder.setBase64Encoded(true);
responseBuilder.setBody(Base64.getEncoder().encodeToString(baos.toByteArray()));
} else {
responseBuilder.setBody(new String(baos.toByteArray(), StandardCharsets.UTF_8));
responseBuilder.setBody(baos.toString(StandardCharsets.UTF_8));
}
}
future.complete(responseBuilder);
Expand Down

0 comments on commit 477b090

Please sign in to comment.