aboutsummaryrefslogtreecommitdiffstats
path: root/tenant-cd
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-03-18 18:05:48 +0100
committerJon Marius Venstad <venstad@gmail.com>2020-03-18 18:05:48 +0100
commit1458c473fbf7e81c2ed29a7d6e718923c3ca8c39 (patch)
tree4ee435045e8e23a6229f077d9023d56723cd7bdc /tenant-cd
parentcf6b86309498abdf1559020594f49312b9c97b76 (diff)
Avoid trailing query delimiter when no query
Diffstat (limited to 'tenant-cd')
-rw-r--r--tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java
index 0c81b483ba0..cf32683ce19 100644
--- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java
+++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java
@@ -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.entrySet().stream()
- .map(entry -> encode(entry.getKey(), UTF_8) + "=" + encode(entry.getValue(), UTF_8))
- .collect(Collectors.joining("&", "?", ""))));
+ (properties.isEmpty() ? "" : properties.entrySet().stream()
+ .map(entry -> encode(entry.getKey(), UTF_8) + "=" + encode(entry.getValue(), UTF_8))
+ .collect(Collectors.joining("&", "?", "")))));
}
}