fiznool / express-mongo-sanitize

Sanitize your express payload to prevent MongoDB operator injection.
MIT License
217 stars 14 forks source link

Compatible with Express 5? #200

Open Nickk4 opened 3 weeks ago

Nickk4 commented 3 weeks ago

I'm trying to implement express-mongo-sanitize with Express 5.0.1. No matter the configuration, after adding express-mongo-sanitize I get the error:

TypeError: Cannot set property query of #<IncomingMessage> which has only a getter
    at C:\***\node_modules\express-mongo-sanitize\index.js:113:18   // points to: req[key] = target;
    at Array.forEach (<anonymous>)

Any ideas if it's possible to make express-mongo-sanitize work with Express 5?

ghostd commented 2 weeks ago

A PR is already open: https://github.com/fiznool/express-mongo-sanitize/pull/199