Skip to content

Commit 2b11568

Browse files
committed
Fix invalid url when backendurl contains trailing /
1 parent d2c7ff7 commit 2b11568

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/app/core/_services/shared/config.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export class ConfigService {
2121
if (config && config.hashtopolis_backend_url) {
2222
// If we get a config from the backend, we set the config property
2323
ApiEndPoint = config.hashtopolis_backend_url;
24+
// Remove trailing slash, because this causing invalid URLs
25+
if (ApiEndPoint.endsWith('/')) {
26+
ApiEndPoint = ApiEndPoint.slice(0, -1);
27+
}
2428
localStorage.setItem('prodApiEndpoint', ApiEndPoint);
2529
} else if (config && !config.hashtopolis_backend_url) {
2630
console.error('Invalid configuration file. Please check your config.json. Using defaults.');

0 commit comments

Comments
 (0)