bodyLimit middleware trusts Content-Length #4258
sharifmacky
started this conversation in
General
Replies: 1 comment 4 replies
-
Hi @sharifmacky, thank you for your feedback. When we implemented this, we confirmed that regardless of the runtime environment (deno, bun, node-server, etc.), specifying a content-length smaller than the actual body size resulted in a 400 error (or similar). Based on this, we determined that this behavior is reliable and have implemented it accordingly. Is there a runtime that cannot be trusted? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Why does the bodyLimit middleware trust the Content-Length header? I can manually set its value to any small value and the middleware skips checking the limit and happily parses the entire body.
Beta Was this translation helpful? Give feedback.
All reactions