Skip to content

Option to skip parsing #1009

Open
Open
@bogeychan

Description

@bogeychan

What is the problem this feature would solve?

Some routes, as mentioned in the documentation, don't require automatic body parsing at all and break if it occurs because the body is used due to side effects introduced by plugins (i.e. how elysia works)

What is the feature you are proposing to solve the problem?

Allow parse: false option in the route's configuration, or reconsider parsing for plugins that don't access the body but Context

app.post("/", betterAuthView, {
  parse: false,
});

Allowing something like this should also improve performance

What alternatives have you considered?

I tried this, but it is inconsistent with aot: false, in some cases and bad UX:

app.post("/", betterAuthView, {
  parse: () => 0,
});

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