aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/main
diff options
context:
space:
mode:
authorFrode Lundgren <frodelu@verizonmedia.com>2020-08-03 16:45:19 +0200
committerFrode Lundgren <frodelu@verizonmedia.com>2020-08-03 16:45:19 +0200
commit40d4262126e4a4ae7aa76f7d0cb9f2942c695ce4 (patch)
treecfd99722abe6674e4abf9b7d5f98b79c3b996ca9 /controller-server/src/main
parent93e25aa600eb299be051a9a48523f47c86dc0246 (diff)
Have URL query parameters handled appropriately to fix URL encoding issues
Diffstat (limited to 'controller-server/src/main')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
index 5b35a1aa5c1..c5fb507749c 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
@@ -987,7 +987,7 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
toSlime(endpoint, endpointArray.addObject());
}
- response.setString("nodes", withPath("/zone/v2/" + deploymentId.zoneId().environment() + "/" + deploymentId.zoneId().region() + "/nodes/v2/node/?&recursive=true&application=" + deploymentId.applicationId().tenant() + "." + deploymentId.applicationId().application() + "." + deploymentId.applicationId().instance(), request.getUri()).toString());
+ response.setString("nodes", withPathAndQuery("/zone/v2/" + deploymentId.zoneId().environment() + "/" + deploymentId.zoneId().region() + "/nodes/v2/node/", "recursive=true&application=" + deploymentId.applicationId().tenant() + "." + deploymentId.applicationId().application() + "." + deploymentId.applicationId().instance(), request.getUri()).toString());
response.setString("yamasUrl", monitoringSystemUri(deploymentId).toString());
response.setString("version", deployment.version().toFullString());
response.setString("revision", deployment.applicationVersion().id());
@@ -1693,16 +1693,21 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
object.setString("url", withPath("/application/v4/tenant/" + tenant.name().value(), requestURI).toString());
}
- /** Returns a copy of the given URI with the host and port from the given URI and the path set to the given path */
- private URI withPath(String newPath, URI uri) {
+ /** Returns a copy of the given URI with the host and port from the given URI, the path set to the given path and the query set to given query*/
+ private URI withPathAndQuery(String newPath, String newQuery, URI uri) {
try {
- return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), newPath, null, null);
+ return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), newPath, newQuery, null);
}
catch (URISyntaxException e) {
throw new RuntimeException("Will not happen", e);
}
}
+ /** Returns a copy of the given URI with the host and port from the given URI and the path set to the given path */
+ private URI withPath(String newPath, URI uri) {
+ return withPathAndQuery(newPath, null, uri);
+ }
+
private long asLong(String valueOrNull, long defaultWhenNull) {
if (valueOrNull == null) return defaultWhenNull;
try {