Added trailing slash to API endpoint in widget URLs

This commit is contained in:
Pablo Alonso Garcia 2015-10-26 17:50:50 +01:00
parent 50e63bf83d
commit 7b57d22444
2 changed files with 8 additions and 3 deletions

View File

@ -349,13 +349,13 @@ function getUrls(username, resource) {
var cdnUrl = global.environment.serverMetadata && global.environment.serverMetadata.cdn_url;
if (cdnUrl) {
return {
http: 'http://' + cdnUrl.http + '/' + username + '/api/v1/map' + resource,
https: 'https://' + cdnUrl.https + '/' + username + '/api/v1/map' + resource
http: 'http://' + cdnUrl.http + '/' + username + '/api/v1/map/' + resource,
https: 'https://' + cdnUrl.https + '/' + username + '/api/v1/map/' + resource
};
} else {
var port = global.environment.port;
return {
http: 'http://' + username + '.' + 'localhost.lan:' + port + '/api/v1/map' + resource
http: 'http://' + username + '.' + 'localhost.lan:' + port + '/api/v1/map/' + resource
};
}
}

View File

@ -72,7 +72,12 @@ describe('lists', function() {
return next(err);
}
var parsedBody = JSON.parse(res.body);
var expectedWidgetURLS = {
"http": "http://localhost.localhost.lan:8888" +
"/api/v1/map/adfb1f912ddb9a5af5e9ef0b2229ed3b:1234567890123/0/widget/names"
};
assert.ok(parsedBody.metadata.layers[0].widgets.names);
assert.equal(parsedBody.metadata.layers[0].widgets.names.url.http, expectedWidgetURLS.http);
return next(null, parsedBody.layergroupid);
}
);