Skip to content

useBody does not work on unenv direct call #8

Description

@farnabaz

I'm not sure if here is the correct place to create an issue, feel to close/move it.

Using h3 useBody with localCall (with unenv) leads to forever waiting promise and as the cause API never return data. (req.on('end') never calls https://github.com/unjs/h3/blob/main/src/utils/body.ts#L27)

As a solution (since unenv set req.body), we can check for req.body inside useBody and use it as parsed body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions