diff --git a/packages/nacos-config/src/http_agent.ts b/packages/nacos-config/src/http_agent.ts index 02766fd..40aef69 100644 --- a/packages/nacos-config/src/http_agent.ts +++ b/packages/nacos-config/src/http_agent.ts @@ -71,7 +71,7 @@ export class HttpAgent { } get contextPath() { - return this.configuration.get(ClientOptionKeys.CONTEXTPATH) || 'nacos'; + return this.configuration.get(ClientOptionKeys.CONTEXTPATH) || ''; } get clusterName() { @@ -216,7 +216,7 @@ export class HttpAgent { url = `https://${currentServer}:${this.serverPort}`; } } - return `${url}/${this.contextPath}`; + return `${url}${this.contextPath ? `/${this.contextPath}` : ''}`; } decodeResData(res, method = 'GET') {