Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Body limit in oak@13+ #663

Open
andreial opened this issue Jul 16, 2024 · 1 comment
Open

Body limit in oak@13+ #663

andreial opened this issue Jul 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@andreial
Copy link

Before oak@13, we were able to add a limit to body:

ctx.request.body({ type: 'json', limit: maxHttpBodyBytes }).value

which was throwing BadRequest whenever the request body was exceeding that limit.

Is there a way to do this using the new body API?

@kitsonk kitsonk added the enhancement New feature or request label Jul 17, 2024
@kitsonk
Copy link
Collaborator

kitsonk commented Jul 17, 2024

There are some challenges because of the underlying changes of the way Deno HTTP server works. In other runtimes like Bun, it is controllable at the HTTP server, and there isn't a consistent way to enforce that in the middleware framework. It isn't a bad idea, but there isn't a clear way to implement that is obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants