koa-content-filter
Version:
A simple but powerful content-filter. Also provides protection against NoSQL (like MongoDB) injection attacks on Node.js
24 lines (17 loc) • 688 B
Markdown
# Koa-content-filter
<span>[](https://travis-ci.org/efkan/content-filter)</span>
A third-party middleware for Koa to prevent NoSQL injection.
This is a improved version from efkan's [content-filter](https://github.com/efkan/content-filter) to adapt koa-ecosystem.So, you can find more infomations there.
### Usage
```
const filter = require('koa-content-filter');
app.use(filter());
```
Then, if anyone send a request with blackblist(url or body) words like `$` will recive :
```
{
"status": 403,
"code": "FORBIDDEN_CONTENT",
"message": "A forbidden expression has been found in URL: $"
}
```