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

QueryParameters#splitEntries fails with java.util.NoSuchElementException #20

Closed
criedel opened this issue Nov 5, 2015 · 2 comments
Closed
Assignees
Labels

Comments

@criedel
Copy link

criedel commented Nov 5, 2015

Given a URL with an undefined query parameter value http://example.com/?param the QueryParameters#splitEntries will throw a java.util.NoSuchElementException.
The library should either ignore those parameters or support them. IMHO actual error handling should occur in the application code.

@whiskeysierra whiskeysierra self-assigned this Nov 6, 2015
@whiskeysierra
Copy link
Collaborator

It's definitely a bug. We should support any format of the query string since according to the official URI specification RFC3986 does not have a defined format. It's just that most implementations support key value pairs.

The query component contains non-hierarchical data that, along with
data in the path component (Section 3.3), serves to identify a
resource within the scope of the URI's scheme and naming authority
(if any). [...] However, as query components
are often used to carry identifying information in the form of
"key=value" pairs and one frequently used value is a reference to
another URI, [...].

@whiskeysierra
Copy link
Collaborator

@criedel I created a bugfix including some unit tests. Would this fix your problem?

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

No branches or pull requests

2 participants