expressjs / expressjs/cookie-parser
perf: limit cookie parse only on some cookie
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
Hi, in my express I use only 1 cookie (`API_TOKEN`), but client side send varius cookie eg:
```
_ga_M9MSXKVJN9=XXXX;
_ga_W98228BE06=XXXX;
_gid=XXXX; _ga=XXXX;
_gcl_au=XXXX;
_ga_5MFMLYZHT2=XXXX;
rxVisitor=XXXX;
_ga_K4Y50QD36K=XXXX;
dtCookie=XXXX;
dtSa=XXXX;
rxvt=XXXX;
API_TOKEN=XXXX;
```
the `_g*` cookies are Google Analitycs / Google Tag Manage
the `_dt*` and `rx*` cookies are Dynatrace
the `API_TOKEN` is the only one used by my express!
Parsig all those cookies on each request has a performance impact!
The idea is introduce an option for limit the cookie parsing on a limit numer of cookies, eg.:
```js
app.use(cookieParser({null, {
allowedCookie: ['API_TOKEN']
}}))
```
Contributor guide
Assessment
This issue has not been assessed yet.