fix: add trailing / to endpoint

Closes #2363
This commit is contained in:
Rhys Arkins 2018-08-20 12:53:57 +02:00
parent 93d02e5e75
commit d1ee797e54
3 changed files with 5 additions and 4 deletions

View file

@ -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);

View file

@ -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,

View file

@ -2,7 +2,7 @@
exports[`util/endpoints find() allows overrides 1`] = `
Object {
"endpoint": "endpoint",
"endpoint": "endpoint/",
"name": "GitHub",
"other": "data",
"platform": "github",