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 data not passed correctly to the express app #654

Open
cwkang1998 opened this issue Jun 20, 2023 · 1 comment
Open

body data not passed correctly to the express app #654

cwkang1998 opened this issue Jun 20, 2023 · 1 comment

Comments

@cwkang1998
Copy link

Currently, when using express, the req.body data is incorrectly passed to the express application. I am getting the gibberish trash data from somewhere passed into the request. This problem does not exists if I use getCurrentInvoke to get the body data, which will be correct.

Propose to fix this by changing this line here https://github.com/vendia/serverless-express/blob/mainline/src/frameworks/express.js#L2 from app.handle to app, which should solve the issue. See https://github.com/expressjs/express/blob/master/lib/express.js#L38.

Currently I am using express v4, not sure if this will be the case for express v5 or even prior versions.

I will be more than happy to work on this issue (and other issues as a contributor).

Maybe we can make the event & context data not available for the express Request object in the future as well for convenience.

@rodeyseijkens
Copy link

I'm currently experiencing the same issue where the body data gets returned as a Buffer for some reason.
The event.body that is coming from the handler directly it looks fine if I log that.

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

No branches or pull requests

2 participants