Skip to content

Setting req.query #3472

Description

@arb

In my validation package celebrate, I run joi against the parsed query string. If there are any transformations applied (default value, convert "1" to 1, etc.) I want to set that result back to req.query so any downstream functions are working with the validated and updated query object.

In versions 3 and 4 of express, it's as simple as req.query = UPDATED_QUERY. In version 5, because of this change it's not as simple anymore.

What is the recommended way for doing this in version 5?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions