diff --git a/lib/util/endpoints.js b/lib/util/endpoints.js index b70c7313745b1fb5a2020409f4c4c806ac1ece95..bdfe69488eaa860128020bbb67b1f190e414644d 100644 --- a/lib/util/endpoints.js +++ b/lib/util/endpoints.js @@ -28,6 +28,7 @@ function update(params) { `Failed to configure platform '${platform}': no endpoint defined` ); } + config.endpoint = endpoint.replace(/[^/]$/, '$&/'); let { host } = config; // extract host from endpoint host = host || (endpoint && URL.parse(endpoint).host); diff --git a/test/platform/vsts/__snapshots__/vsts-got-wrapper.spec.js.snap b/test/platform/vsts/__snapshots__/vsts-got-wrapper.spec.js.snap index 6e84ab82bc8993d8b3674feecae36ca3c375b591..30c551641faf862f5432aa83eb5844d7e4960db9 100644 --- a/test/platform/vsts/__snapshots__/vsts-got-wrapper.spec.js.snap +++ b/test/platform/vsts/__snapshots__/vsts-got-wrapper.spec.js.snap @@ -25,12 +25,12 @@ WebApi { "userAgent": "vsts-node-api", }, }, - "serverUrl": "myEndpoint", + "serverUrl": "myEndpoint/", "vsoClient": VsoClient { "_initializationPromise": Promise {}, "_locationsByAreaPromises": Object {}, - "basePath": "myEndpoint", - "baseUrl": "myEndpoint", + "basePath": "myEndpoint/", + "baseUrl": "myEndpoint/", "restClient": RestClient { "client": HttpClient { "_certConfig": undefined, diff --git a/test/util/__snapshots__/endpoints.spec.js.snap b/test/util/__snapshots__/endpoints.spec.js.snap index 96c7b38024079953f76308cdb4394bb86f63160d..c9e912f388154dff7886f892d1804a5a744b1d0d 100644 --- a/test/util/__snapshots__/endpoints.spec.js.snap +++ b/test/util/__snapshots__/endpoints.spec.js.snap @@ -2,7 +2,7 @@ exports[`util/endpoints find() allows overrides 1`] = ` Object { - "endpoint": "endpoint", + "endpoint": "endpoint/", "name": "GitHub", "other": "data", "platform": "github",