Handle query both in given path and properties map
@@ -56,9 +56,9 @@ public class HttpEndpoint implements Endpoint {
@Override
public HttpRequest.Builder request(String path, Map<String, String> properties) {
return HttpRequest.newBuilder(endpoint.resolve(path +
- (properties.isEmpty() ? "" : properties.entrySet().stream()
+ properties.entrySet().stream()
.map(entry -> encode(entry.getKey(), UTF_8) + "=" + encode(entry.getValue(), UTF_8))
- .collect(Collectors.joining("&", "?", "")))));
+ .collect(Collectors.joining("&", path.contains("?") ? "&" : "?", ""))));
}
}
