Ensure trailing / in Pl3xmap base URL

This commit is contained in:
James Lyne 2021-09-28 13:33:05 +01:00
parent 98d7ede3d9
commit 0ae8b11ce6

View File

@ -41,6 +41,11 @@ const validateLiveAtlasConfiguration = (config: any): Map<string, LiveAtlasServe
if(typeof serverConfig.pl3xmap !== 'undefined') { if(typeof serverConfig.pl3xmap !== 'undefined') {
serverConfig.type = 'pl3xmap'; serverConfig.type = 'pl3xmap';
// Ensure trailing /
if(serverConfig.pl3xmap.slice(-1) !== '/') {
serverConfig.pl3xmap = `${serverConfig.pl3xmap}/`;
}
} else if(typeof serverConfig.dynmap !== 'undefined') { } else if(typeof serverConfig.dynmap !== 'undefined') {
if (!serverConfig.dynmap || serverConfig.dynmap.constructor !== Object) { if (!serverConfig.dynmap || serverConfig.dynmap.constructor !== Object) {
throw new ConfigurationError(`Server '${server}': Dynmap configuration object missing. ${check}`); throw new ConfigurationError(`Server '${server}': Dynmap configuration object missing. ${check}`);