CodeGenieApp / CodeGenieApp/serverless-express

req.path is incorrect when path ends with slash

Open
#391 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.3k
Forks
676
PR merge metrics
No merged PRs in 30d

Description

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`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.