Skip to content

Body limit in oak@13+ #663

Open
Open

Description

@andreial

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?

Activity

  1. kitsonk commented on Jul 17, 2024

    @kitsonk
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions