mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
XSS: Simplified by adding XSS middleware
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { Request, Response, NextFunction } from 'express'
|
||||
let stripJs = require('strip-js')
|
||||
|
||||
export function sanitizeMiddleware(req: Request, res: Response, next: NextFunction): void {
|
||||
req.url = stripJs(req.url)
|
||||
for (let p in req.query) {
|
||||
req.query[p] = stripJs(req.query[p])
|
||||
}
|
||||
|
||||
next()
|
||||
}
|
||||
Reference in New Issue
Block a user