prism
prism copied to clipboard
fix(http-server): discard request body if the content-length header i…
Addresses #2102
Summary
This PR changes the condition of the HTTP server resolving the request body. It assumes that the body is null in case of an explicit Content-Length: 0
.
Since in #1990 the decision was made to assume no body in case of no explicit Content-Length
other than zero (omitting will assume no body - which seems matching the HTTP/1.1 spec), however I didn't follow the same approach as it could be seen as a minor changes (as apposite to a patch).
Let me know if you would like me to default it to 0 in case if missing as well!
Checklist
- The basics
- [X] I tested these changes manually in my local or dev environment (Running + Docker)
- Tests
- [X] Added or updated
- [ ] N/A
- Event Tracking
- [ ] I added event tracking and followed the event tracking guidelines
- [ ] N/A
- Error Reporting
- [X] I reported errors and followed the error reporting guidelines
- [ ] N/A
Screenshots
Before
After
Additional context
N/A
This has been released in version 4.10.2 🎉
@chohmann This looks to be causing a breakage where requests are accepted when no body is provided, but the body is defined as having one or more required parameters and should thus be rejected.