prism icon indicating copy to clipboard operation
prism copied to clipboard

fix(http-server): discard request body if the content-length header i…

Open acolombier opened this issue 1 year ago • 0 comments

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 image

After image

Additional context

N/A

acolombier avatar Aug 06 '22 15:08 acolombier

This has been released in version 4.10.2 🎉

chohmann avatar Aug 11 '22 14:08 chohmann

@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.

childish-sambino avatar Aug 24 '22 17:08 childish-sambino