Skip to content

Commit 4fd3da4

Browse files
committed
Update to allow Azure Functions to automatically handle content lenght and transer encoding. This fixes an issue that was breaking the text/plain responses for when eventLogDump=true parameter is used. Azure Functions seems to handle this correctly and automatically so we should let it do so -- now using Transfer-Encoding: chunked.
1 parent 3f1426e commit 4fd3da4

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

apachefop-serverless-az-func/src/main/java/com/cajuncoding/apachefop/serverless/http/HttpHeaders.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ public class HttpHeaders {
99
public static final String CONTENT_ENCODING = "Content-Encoding";
1010
public static final String CONTENT_ENCODING_LOWERCASE = CONTENT_ENCODING.toLowerCase();
1111

12-
public static final String CONTENT_LENGTH = "Content-Length";
1312
public static final String CONTENT_DISPOSITION = "Content-Disposition";
1413
}

apachefop-serverless-az-func/src/main/java/com/cajuncoding/apachefop/serverless/web/ApacheFopServerlessResponseBuilder.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public HttpResponseMessage BuildPdfResponse(
6060
.createResponseBuilder(HttpStatus.OK)
6161
.body(fopPdfBytes)
6262
.header(HttpHeaders.CONTENT_TYPE, MimeConstants.MIME_PDF)
63-
.header(HttpHeaders.CONTENT_LENGTH, Integer.toString(fopPdfBytes.length))
6463
.header(HttpHeaders.CONTENT_DISPOSITION, MessageFormat.format("inline; filename=\"{0}\"", fileName))
6564
.header(ApacheFopServerlessHeaders.APACHEFOP_SERVERLESS_EVENTLOG_ENCODING, eventLogSafeHeaderValue.getEncoding())
6665
.header(ApacheFopServerlessHeaders.APACHEFOP_SERVERLESS_EVENTLOG, eventLogSafeHeaderValue.getValue())
@@ -83,7 +82,6 @@ public HttpResponseMessage BuildEventLogDumpResponse(
8382
.createResponseBuilder(HttpStatus.OK)
8483
.body(eventLogText)
8584
.header(HttpHeaders.CONTENT_TYPE, MimeConstants.MIME_PLAIN_TEXT)
86-
.header(HttpHeaders.CONTENT_LENGTH, Integer.toString(eventLogText.length()))
8785
.build();
8886

8987
return response;

0 commit comments

Comments
 (0)