CodeGenieApp / CodeGenieApp/serverless-express

`body` data not passed correctly to the express app

Aperta
#654 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
5.3k
Fork
676
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia da src/frameworks/express.js alla riga 2 e confronta il riferimento attuale a app.handle con lib/express.js di Express alla riga 38. Verifica che Express 4 req.body corrisponda al body ottenuto tramite getCurrentInvoke e controlla il comportamento rispetto all'incertezza indicata sulla versione di Express.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
express, javascript, node.js
Ambito
api, backend
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.