Skip to content

Commit

Permalink
Undo optimization from 12fe2c that can cause regression
Browse files Browse the repository at this point in the history
Closes gh-31327
  • Loading branch information
rstoyanchev committed Sep 29, 2023
1 parent a2c5fed commit 23162bb
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ public boolean supports(Class<?> clazz) {
@Override
protected String readInternal(Class<? extends String> clazz, HttpInputMessage inputMessage) throws IOException {
Charset charset = getContentTypeCharset(inputMessage.getHeaders().getContentType());
long length = inputMessage.getHeaders().getContentLength();
byte[] bytes = (length >= 0 && length <= Integer.MAX_VALUE ?
inputMessage.getBody().readNBytes((int) length) :
inputMessage.getBody().readAllBytes());
return new String(bytes, charset);
return StreamUtils.copyToString(inputMessage.getBody(), charset);
}

@Override
Expand Down

0 comments on commit 23162bb

Please sign in to comment.