Skip to content

Commit

Permalink
Fill headers before body in ParsedHttpMessagesAsDicts
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Kurait <akurait@amazon.com>
  • Loading branch information
AndreKurait committed May 1, 2024
1 parent d350a02 commit c23ecef
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,8 @@ private static Map<String, Object> fillMap(LinkedHashMap<String, Object> map,
try (var encodedBufHolder = RefSafeHolder.create(Base64.encode(content, false, Base64Dialect.STANDARD))) {
var encodedBuf = encodedBufHolder.get();
assert encodedBuf != null : "Base64.encode should not return null";
String base64body = encodedBuf.toString(StandardCharsets.UTF_8);
map.put("body", base64body);
headers.entries().forEach(kvp -> map.put(kvp.getKey(), kvp.getValue()));
map.put("body", encodedBuf.toString(StandardCharsets.UTF_8));
return map;
}
}
Expand Down

0 comments on commit c23ecef

Please sign in to comment.