Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default sanitizer does not work with checkSchema when checking query #1071

Open
nikli2009 opened this issue Jul 29, 2021 · 0 comments · May be fixed by #1070
Open

Default sanitizer does not work with checkSchema when checking query #1071

nikli2009 opened this issue Jul 29, 2021 · 0 comments · May be fixed by #1070
Labels

Comments

@nikli2009
Copy link
Contributor

nikli2009 commented Jul 29, 2021

Describe the bug

Given this schema.

const schema = {
      foo: {
        default: {
          options: 10,
        },
      },
}

and this route

app.use('/test', checkSchema(schema), testController)

When request /test?foo or /test?foo=, the default option does not work.

To Reproduce

As described above. 👆👆

Expected behavior

the request query : req.query should be transformed to

{ foo: 10 }

Current behavior

the request query : req.query is

{ }

Express-validator version:

  • Version: 6.12.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants