Strict Routing
Open
4.x
awaiting more info
- Dominant language
- JavaScript
- Stars
- 69.5k
- Forks
- 25k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
I've been experimenting with strict routing using `express@latest` and have found that the following the requests all route to the same path when supplying `strict: true` to express. This doesn't seem to uphold the docs explanation of `Disabled by default, “/foo” and “/foo/” are treated the same by the router.`.
```js
const express = require('express')
const app = express({ strict: true })
const port = 3022
app.get('/:param?/', (req, res) => res.json(req.params.param));
app.listen(port);
```
```
> curl -I http://localhost:3022/
HTTP/1.1 200 OK
> curl -I http://localhost:3022/abc
HTTP/1.1 200 OK
> curl -I http://localhost:3022/abc/
HTTP/1.1 200 OK
```
Contributor guide
Assessment
This issue has not been assessed yet.