restify / restify/node-restify
Query Params Got Modify
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 975
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 5
Description
node: 6.x.x
restify: 6.2.3
I got some unmatch query params while requesting to my api. for example
if i hit http://myapi/content/1?verify=true&released=true
it suppose read as
{
verify: 'true',
released: 'true'
}
on the req.query
but instead i got
{
verify: ['true', 'true'],
released: 'true'
}
any ideas why this is happend ?
on my server config :
self._server.pre(cors.preflight);
self._server.use(cors.actual);
self._server.use(restify.plugins.queryParser({
mapParams: true
}));
self._server.use(restify.plugins.bodyParser({
mapParams: true
}));
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the request with the shown queryParser and bodyParser configuration, then trace how req.query is populated for repeated or duplicated parameters. Done means identifying why verify becomes an array while released does not, and documenting the expected behavior or the relevant configuration change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100