Skip to content

Commit

Permalink
Fixes #613
Browse files Browse the repository at this point in the history
  • Loading branch information
skarpenko committed Nov 14, 2023
1 parent d890bd6 commit 2fabc73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,12 @@ private String queryLine(Map<String, Collection<String>> queries) {
Collection<String> valuesEncoded = query.getValue().stream()
.map(value -> UriUtils.encode(value, UTF_8))
.collect(toList());
queryBuilder.append('&');
queryBuilder.append(collectionFormat.join(query.getKey(), valuesEncoded, UTF_8));

CharSequence queryString = collectionFormat.join(query.getKey(), valuesEncoded, UTF_8);
if(queryString.length() > 0){
queryBuilder.append('&');
queryBuilder.append(queryString);
}
}
if(queryBuilder.length() > 0) {
queryBuilder.deleteCharAt(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void shouldPassEmptyParameterInUrl() {

@Test
public void shouldNotReturnNullPassedParametersNew() {
Map<String, String> paramMap = new HashMap<String, String>() {
Map<String, String> paramMap = new HashMap<>() {
{
put("paramKey", "paramValue");
put("paramKeyNull", null);
Expand Down

0 comments on commit 2fabc73

Please sign in to comment.