I think proxyClientMaxBodySize should not be implemented like this #89404
Unanswered
lkho
asked this question in
App Router
Replies: 0 comments
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.
-
Just as the title states, that's only IMHO, so I think starting a discussion is better to see if others encounter the same problem.
I did researched some other issues/threads such as #86985 and dig the source code,
and found that when this feature is introduced (that means I need a middleware/proxy setup), the only way to get back the full request body, as the docs mentioned (you actually got only ONE option), is to increase that limit to the max size of your body. The other option to handle partial body is not feasible, since data is lost already.
You still get yet another option: remove the middleware/proxy (still unfeasible)
My point is that even if my middleware is not ever using the body, it still get captured and truncated without any options to disable that.
I suggest that the body should be:
So users with simple middleware not using body at all (like me), is not affected;
Users with small bodies (within the buffer limit), can still read the body multiple times as usual;
User with large bodies (usually file uploads), they can choose whether to touch the body or not based on routing or other request params.
Beta Was this translation helpful? Give feedback.
All reactions