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

Imposible to get float params from url string #60

Open
ChronicusUA opened this issue Jun 27, 2012 · 2 comments
Open

Imposible to get float params from url string #60

ChronicusUA opened this issue Jun 27, 2012 · 2 comments

Comments

@ChronicusUA
Copy link

Example map:

thingsResource.map('get', '/:min/:max', thingsRouts.getMinMax)

Min and max is float.
I'm making 'get' request to url: things/12.22/12.45 or things/12.22/12.45/
I expected: req.params.min = 12.22 and req.params.max = 12.45, but i get: req.params.max = 12 and req.params.format = 45 instead

Easy workarouund is just make request like: things/12.22/12.45. <- this point is required.

Sorry for my bad english :)

@tj
Copy link
Member

tj commented Jun 27, 2012

yeah that's the downside of supporting "formats" in the pathname (".json" etc), where Accept is really what should be used. IMO we should remove support for them or whitelist specific ones

@ChronicusUA
Copy link
Author

Yes, I understand it. But may be for float values you could do follow: get format and do parseInt for format if is number - you could thing that is float ;)
And for text values with point, may be use something like '.'

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

2 participants