Skip to content

Commit

Permalink
fixes #2035 handle the empty response body in the ResponseBodyInterce…
Browse files Browse the repository at this point in the history
…ptor (#2036)
  • Loading branch information
stevehu authored Dec 8, 2023
1 parent baaa7ad commit 239d446
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ else if (this.isFormData(contentType))
*/
private boolean attachJsonBody(final HttpServerExchange ex, String str) {
str = str.trim();

if(str.isEmpty()) {
// if an empty string is passed in, we should not try to parse it. Just cache it.
this.cacheResponseBody(ex, str);
return true;
}
if (str.charAt(0) == JSON_MAP_OBJECT_STARTING_CHAR) {
this.cacheResponseBody(ex, str);
return this.parseJsonMapObject(ex, AttachmentConstants.REQUEST_BODY, str);
Expand Down

0 comments on commit 239d446

Please sign in to comment.