Skip to content

Commit

Permalink
changed the behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred1155 committed Jan 25, 2025
1 parent 6ab6e5e commit a1fd7b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public static Map<String, List<String>> uriParams(URI uri) {
return splitQueryString(uri.getRawQuery())
.stream()
.map(s -> s.split("="))
.filter(s -> s.length > 0)
.map(s -> s.length == 0 ? new String[] {""}: s)
.map(s -> s.length == 1 ? new String[] { s[0], null } : s)
.collect(groupingBy(a -> urlDecode(a[0]), mapping(a -> urlDecode(a[1]), toList())));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public void uriParams() throws URISyntaxException {
public void uriParamsWithSingleEqualQuery() throws URISyntaxException {
URI uri = URI.create("http://example.com?=");
Map<String, List<String>> uriParams = SdkHttpUtils.uriParams(uri);
assertThat(uriParams).isEmpty();
assertThat(uriParams).contains(entry("", Arrays.asList((String)null)));
}

@Test
Expand Down

0 comments on commit a1fd7b8

Please sign in to comment.