CodeGenieApp / CodeGenieApp/serverless-express
req.path is incorrect when path ends with slash
- Lingua principale
- JavaScript
- Stelle
- 5.3k
- Fork
- 676
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
req.path is set like below.
```
1. https://domain/test => req.path = '/test'
2. https://domain/test/ => req.path = '/test'
```
2 is not correct, since Express actually set '/test/' to path in this case.
I think the cause is that the `req.path` is obtained from `event.pathparameters.proxy` instead of `event.path`, and the last slash is not included in `event.pathparameters.proxy`.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia individuando dove req.path viene derivato da event.pathparameters.proxy e confrontalo con event.path per le richieste che terminano con una barra. Aggiungi un caso di regressione che copra /test e /test/, quindi verifica che il req.path risultante preservi la barra finale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, express, javascript
- Ambito
- api, backend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100