1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

Add support for helpers in environment service (#353)

This commit is contained in:
Oscar Hinton
2021-07-23 22:46:32 +02:00
committed by GitHub
parent 230e00e423
commit 4ec06bbd1e
7 changed files with 13 additions and 13 deletions

View File

@@ -99,12 +99,13 @@ export class SendReceiveCommand extends DownloadCommand {
}
private getApiUrl(url: URL) {
const urls = this.environmentService.getUrls();
if (url.origin === 'https://send.bitwarden.com') {
return 'https://vault.bitwarden.com/api';
} else if (url.origin === this.apiService.apiBaseUrl) {
} else if (url.origin === urls.api) {
return url.origin;
} else if (this.platformUtilsService.isDev() && url.origin === this.environmentService.getWebVaultUrl()) {
return this.apiService.apiBaseUrl;
} else if (this.platformUtilsService.isDev() && url.origin === urls.webVault) {
return urls.api;
} else {
return url.origin + '/api';
}