diff options
Diffstat (limited to 'storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp')
-rw-r--r-- | storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp b/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp index 7139ab0eb41..b2bce8a1241 100644 --- a/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp +++ b/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp @@ -169,10 +169,21 @@ void StatusWebServer::handlePage(const framework::HttpUrlPath& urlpath, vespalib::Portal::GetRequest request) { vespalib::string link(urlpath.getPath()); - if (!link.empty() && link[0] == '/') link = link.substr(1); + + // We allow a fixed path prefix that aliases down to whatever is provided after the prefix. + vespalib::stringref optional_status_path_prefix = "/contentnode-status/v1/"; + if (link.starts_with(optional_status_path_prefix)) { + link = link.substr(optional_status_path_prefix.size()); + } + + if (!link.empty() && link[0] == '/') { + link = link.substr(1); + } size_t slashPos = link.find('/'); - if (slashPos != std::string::npos) link = link.substr(0, slashPos); + if (slashPos != std::string::npos) { + link = link.substr(0, slashPos); + } if ( ! link.empty()) { const framework::StatusReporter *reporter = _reporterMap.getStatusReporter(link); |