summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorAndreas Eriksen <andreer@yahooinc.com>2023-01-06 15:07:33 +0100
committerGitHub <noreply@github.com>2023-01-06 15:07:33 +0100
commit1f2e4cf0fc0473c1c401fe755b3e9b862d3468b7 (patch)
tree8efaa7b8d5dc598533bcb67801e31173f2b3b6a6 /configserver
parent30e5553ac101d0968c983724a527001e5967ea17 (diff)
prepend api path for proxy requests to storage/distributor (#25426)
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java1
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java2
2 files changed, 2 insertions, 1 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
index 4d28b58beb3..68d0b81dc2b 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
@@ -147,6 +147,7 @@ public class ApplicationHandler extends HttpHandler {
break;
case "distributor":
case "storagenode":
+ pathPrefix = pathPrefix.append("contentnode-status").append("v1");
break;
default:
throw new com.yahoo.vespa.config.server.NotFoundException("No status page for service: " + service);
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java
index 4cb69290e2f..3925899e1cd 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java
@@ -392,7 +392,7 @@ public class ApplicationHandlerTest {
assertHttpStatusCodeAndMessage(response, 200, "text/html", "<html>host=foo.yahoo.com,service=distributor,path=path '/state/v1/something/more',query=query 'foo=bar',forwardedUrl=https://api:123/my/base/path?bar=.</html>");
response = mockHandler.handle(createTestRequest(toUrlPath(applicationId, Zone.defaultZone(), true) + "/service/distributor/" + host + "/status/something?foo=bar", GET));
- assertHttpStatusCodeAndMessage(response, 200, "text/html", "<html>host=foo.yahoo.com,service=distributor,path=path '/something',query=query 'foo=bar'</html>");
+ assertHttpStatusCodeAndMessage(response, 200, "text/html", "<html>host=foo.yahoo.com,service=distributor,path=path '/contentnode-status/v1/something',query=query 'foo=bar'</html>");
response = mockHandler.handle(createTestRequest(toUrlPath(applicationId, Zone.defaultZone(), true) + "/service/fake-service/" + host + "/status/something?foo=bar", GET));
assertHttpStatusCodeAndMessage(response, 404, "{\"error-code\":\"NOT_FOUND\",\"message\":\"No status page for service: fake-service\"}");