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

named parameters and req.query #6

Closed
ryanramage opened this issue Jan 14, 2018 · 5 comments
Closed

named parameters and req.query #6

ryanramage opened this issue Jan 14, 2018 · 5 comments

Comments

@ryanramage
Copy link

I have a route defined with

app.put('/hash/:id', (req, res) => {

and when a do a PUT with a querystring as well as a named param, eg

http PUT "localhost:12227/hash/ab?ts=123132&ryan=3232"

the query is appended to the named param, eg

 console.log(req.params.id, req.query)
> ab?ts=123132&ryan=3232 ts=123132&ryan=3232
@Youngestdev
Copy link

Sorry, can you break down what you're trying to say ?

@ryanramage
Copy link
Author

req.params.id should be just 'ab' in this case, but it is 'ab?ts=123132&ryan=3232'.

the querystring is being appended to the named param when it should not be.

Maybe this is just a bug in https://github.com/lukeed/trouter but I thought I would raise it here first.

@lukeed
Copy link
Owner

lukeed commented Jan 14, 2018

Ah, whoops! Never ran into this because none of my apps rely on query params.

Easy fix, out shortly.

@lukeed lukeed closed this as completed in d64ae9e Jan 15, 2018
@lukeed
Copy link
Owner

lukeed commented Jan 15, 2018

Released in 0.2.1, thanks!

@ryanramage
Copy link
Author

Thank you!

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

No branches or pull requests

3 participants