Skip to content

Commit 5a94a5f

Browse files
readme: req.headers are also sanitized (#197)
1 parent 23bfd8e commit 5a94a5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Express 4.x middleware which sanitizes user-supplied data to prevent MongoDB Ope
99

1010
## What is this module for?
1111

12-
This module searches for any keys in objects that begin with a `$` sign or contain a `.`, from `req.body`, `req.query` or `req.params`. It can then either:
12+
This module searches for any keys in objects that begin with a `$` sign or contain a `.`, from `req.body`, `req.query`, `req.headers` or `req.params`. It can then either:
1313

1414
- completely remove these keys and associated data from the object, or
1515
- replace the prohibited characters with another allowed character.
@@ -48,9 +48,9 @@ app.use(bodyParser.json());
4848

4949
// By default, $ and . characters are removed completely from user-supplied input in the following places:
5050
// - req.body
51+
// - req.query
5152
// - req.params
5253
// - req.headers
53-
// - req.query
5454

5555
// To remove data using these defaults:
5656
app.use(mongoSanitize());

0 commit comments

Comments
 (0)