Till Westmann has submitted this change and it was merged.

Change subject: ASTERIXDB-1939: No chunked encoding with content-length.
......................................................................


ASTERIXDB-1939: No chunked encoding with content-length.

Change-Id: I06d561eb023f1c84c531e9b2cfe88a626d7e5280
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1632
Sonar-Qube: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
BAD: Jenkins <[email protected]>
Reviewed-by: Michael Blow <[email protected]>
Integration-Tests: Jenkins <[email protected]>
---
M 
hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
M 
hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/ChunkedResponse.java
2 files changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Michael Blow: Looks good to me, approved
  Jenkins: Verified; No violations found; No violations found; Verified



diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
index 9745091..2b0382b 100755
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
@@ -71,6 +71,7 @@
                 : rootDir + File.separator + "/applications/" + File.separator 
+ deployIdString;
         final HttpMethod method = request.getHttpRequest().method();
         try {
+            response.setStatus(HttpResponseStatus.OK);
             if (method == HttpMethod.PUT) {
                 final ByteBuf content = request.getHttpRequest().content();
                 writeToFile(content, deploymentDir, fileName);
diff --git 
a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/ChunkedResponse.java
 
b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/ChunkedResponse.java
index 1d219ba..8fd444b 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/ChunkedResponse.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/ChunkedResponse.java
@@ -164,6 +164,8 @@
     private void fullResponse(HttpVersion version, HttpResponseStatus status, 
ByteBuf buffer, HttpHeaders headers) {
         DefaultFullHttpResponse fullResponse = new 
DefaultFullHttpResponse(version, status, buffer);
         fullResponse.headers().set(headers);
+        // for a full response remove chunked transfer-encoding and set the 
content length instead
+        fullResponse.headers().remove(HttpHeaderNames.TRANSFER_ENCODING);
         fullResponse.headers().setInt(HttpHeaderNames.CONTENT_LENGTH, 
buffer.readableBytes());
         future = ctx.writeAndFlush(fullResponse);
         headerSent = true;

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1632
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I06d561eb023f1c84c531e9b2cfe88a626d7e5280
Gerrit-PatchSet: 6
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>
Gerrit-Reviewer: Till Westmann <[email protected]>
Gerrit-Reviewer: abdullah alamoudi <[email protected]>

Reply via email to