When we use req.params().get("something"), we may get inconsistent results for these two GET requests:
/mytest -> req.params().get("something") yields None
/mytest?nothing=123 -> req.params().get("something") yields Some(Set.empty)
/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.
When we use
req.params().get("something"), we may get inconsistent results for these two GET requests:/mytest->req.params().get("something")yieldsNone/mytest?nothing=123->req.params().get("something")yieldsSome(Set.empty)/mytest?something=123->req.params().get("something")yieldsSome(Set(123))(which is correct in this case)For cases 1. and 2., shouldn't we get the same result for both?
NoneorSome(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 wasseq.isEmpty) and then we should getNonein both cases.