CodeGenieApp / CodeGenieApp/serverless-express
`body` data not passed correctly to the express app
- Langage dominant
- JavaScript
- Étoiles
- 5.3k
- Forks
- 676
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez à la ligne 2 de src/frameworks/express.js et comparez la référence actuelle de app.handle avec la ligne 38 de lib/express.js d'Express. Vérifiez que Express 4 req.body correspond au body obtenu via getCurrentInvoke, et vérifiez le comportement par rapport à l'incertitude indiquée concernant la version d'Express.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- express, javascript, node.js
- Domaine
- api, backend
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 45/100