Skip to content

Having get parameters can lead to inconsistent results #189

Description

@Narigo

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.

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