Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions examples/http/requests.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### POST request
POST http://localhost:8080/
Content-Type: application/json

{
"name": 1
}

### GET request
GET http://localhost:8080/?fromDate=2020-01-01

### GET request (with body)
GET http://localhost:8080/?fromDate=2020-01-01
Content-Type: application/json

{}
2 changes: 1 addition & 1 deletion examples/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ paths:
description: Update index
operationId: postIndex
requestBody:
required: false
required: true
content:
application/json:
schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public MultiReadContentCachingRequestWrapper(HttpServletRequest request, int con

@Override
public ServletInputStream getInputStream() throws IOException {
var inputStream = super.getInputStream();
if (inputStream.isFinished()) {
return new CachedServletInputStream(getContentAsByteArray());
var cachedContent = getContentAsByteArray();
if (cachedContent.length > 0) {
return new CachedServletInputStream(cachedContent);
}

return inputStream;
return super.getInputStream();
}

@Override
Expand Down