GithubHelp home page GithubHelp logo

Comments (5)

ctavan avatar ctavan commented on May 22, 2024

Hey bminer, thanks for your feedback!

For validation I agree, we should be able to use req.param(). For sanitization however things will become a bit more tricky since we actually want to modify the parameters and req.param() is read-only. So we somehow have to figure out, whether the param we want to sanitize is in req.params, req.query or req.body and write it back to the correct location...

Anyways I agree we should get rid of the mixinParams-method. If you want, you can provide me with a pull-request, otherwise I'll see if I can implement it during the weekend.

from express-validator.

bminer avatar bminer commented on May 22, 2024

Good point. I suppose you could just store back into req.param no matter
what, which is sort of what's happening right now. Or, you could do
something like req.param(...) -- first try replacing req.params[x] if it
exists, otherwise replace req.query[x], then req.body[x]... in that order.
The latter seems like a better approach since you can still access your
vars (sanitized or not) through req.body, req.params, and req.query, but you
can also access them via req.param(...).

I'm not too great with Git, and my time is extremely limited right now. I
could take care of this, but I'd probably just email you the code (I know...
gross). Let me know what you want me to do. If you can get to it this
weekend or whatever, that's fine with me, too. Thanks!

On Thu, Oct 20, 2011 at 8:50 AM, Christoph Tavan <
[email protected]>wrote:

Hey bminer, thanks for your feedback!

For validation I agree, we should be able to use req.param(). For
sanitization however things will become a bit more tricky since we actually
want to modify the parameters and req.param() is read-only. So we somehow
have to figure out, whether the param we want to sanitize is in req.params,
req.query or req.body and write it back to the correct location...

Anyways I agree we should get rid of the mixinParams-method. If you want,
you can provide me with a pull-request, otherwise I'll see if I can
implement it during the weekend.

Reply to this email directly or view it on GitHub:
#1 (comment)

from express-validator.

ctavan avatar ctavan commented on May 22, 2024

If you can wait until the end of the weekend, I'll implement your idea.

from express-validator.

bminer avatar bminer commented on May 22, 2024

Thank you very much! Awesome

from express-validator.

lock avatar lock commented on May 22, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from express-validator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.