Skip to content

Commit

Permalink
Ignore Transfer-Encoding for lambda/azf
Browse files Browse the repository at this point in the history
chunked

chunked

process resource
  • Loading branch information
patriot1burke committed Jun 6, 2023
1 parent e361121 commit 54279b2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ public void handleMessage(Object msg) {
}
final StringBuilder sb = new StringBuilder();
for (Iterator<String> valueIterator = allForName.iterator(); valueIterator.hasNext();) {
sb.append(valueIterator.next());
String val = valueIterator.next();
if (name.equalsIgnoreCase("Transfer-Encoding")
&& val.equals("chunked")) {
continue; // ignore transfer encoding, chunked screws up message and response
}
sb.append(val);
if (valueIterator.hasNext()) {
sb.append(",");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ public void handleMessage(Object msg) {
}
responseBuilder.setMultiValueHeaders(new Headers());
for (String name : res.headers().names()) {
if (name.equalsIgnoreCase("Transfer-Encoding")) {
continue; // ignore transfer encoding, chunked screws up message and response
}
for (String v : res.headers().getAll(name)) {
if (name.equalsIgnoreCase("Transfer-Encoding") && v.contains("chunked")) {
continue;
}
responseBuilder.getMultiValueHeaders().add(name, v);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public void handleMessage(Object msg) {
HttpResponse res = (HttpResponse) msg;
responseBuilder = request.createResponseBuilder(HttpStatus.valueOf(res.status().code()));
for (Map.Entry<String, String> entry : res.headers()) {
if (entry.getKey().equalsIgnoreCase("Transfer-Encoding")
&& entry.getValue().contains("chunked")) {
continue; // ignore transfer encoding, chunked screws up message and response
}
//log.info("header(" + entry.getKey() + ")=" + entry.getValue());
responseBuilder.header(entry.getKey(), entry.getValue());
}
}
Expand Down

0 comments on commit 54279b2

Please sign in to comment.