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

Having get parameters can lead to inconsistent results #189

Open
Narigo opened this issue Jun 29, 2015 · 1 comment
Open

Having get parameters can lead to inconsistent results #189

Narigo opened this issue Jun 29, 2015 · 1 comment

Comments

@Narigo
Copy link
Member

Narigo commented Jun 29, 2015

When we use req.params().get("something"), we may get inconsistent results for these two GET requests:

  1. /mytest -> req.params().get("something") yields None
  2. /mytest?nothing=123 -> req.params().get("something") yields Some(Set.empty)
  3. /mytest?something=123 -> req.params().get("something") yields Some(Set(123)) (which is correct in this case)

For cases 1. and 2., shouldn't we get the same result for both? None or Some(Set.empty)?

The problematic line seems to be this one:

https://github.com/vert-x/mod-lang-scala/blob/master/src/main/scala/org/vertx/scala/core/http/package.scala#L91

If we had if (set.isEmpty) None else Some(set) (before it was seq.isEmpty) and then we should get None in both cases.

@galderz
Copy link
Contributor

galderz commented Aug 20, 2015

@Narigo The bug report is correct, do you want send a PR to fix this?

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