Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This reverts commit ba893a5.
  • Loading branch information
sdelamo committed Aug 21, 2023
1 parent d23b288 commit 6b5e9b9
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,7 @@ protected static HttpMethod parseMethod(Supplier<String> httpMethodConsumer) {

@Override
public InputStream getInputStream() throws IOException {
if (servletByteBuffer == null) {
// Read all the input stream into memory, so we can parse it multiple times (where we need different formats)
this.servletByteBuffer = new ByteArrayByteBuffer<>(getBodyBytes());
}
if (parsedBody != null) {
// We have already parsed a body, this is a second call to getInputStream probably for a different type, so reset the reader.
this.servletByteBuffer.readerIndex(0);
}
return servletByteBuffer.toInputStream();
return servletByteBuffer != null ? servletByteBuffer.toInputStream() : new ByteArrayInputStream(getBodyBytes());
}

@Override
Expand Down

0 comments on commit 6b5e9b9

Please sign in to comment.