mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-06 09:20:43 +01:00
Add getKeyConnectorAlive to ApiService (#543)
This commit is contained in:
parent
ea9a8b979d
commit
07dde6e321
@ -455,4 +455,5 @@ export abstract class ApiService {
|
|||||||
|
|
||||||
getUserKeyFromKeyConnector: (keyConnectorUrl: string) => Promise<KeyConnectorUserKeyResponse>;
|
getUserKeyFromKeyConnector: (keyConnectorUrl: string) => Promise<KeyConnectorUserKeyResponse>;
|
||||||
postUserKeyToKeyConnector: (keyConnectorUrl: string, request: KeyConnectorUserKeyRequest) => Promise<void>;
|
postUserKeyToKeyConnector: (keyConnectorUrl: string, request: KeyConnectorUserKeyRequest) => Promise<void>;
|
||||||
|
getKeyConnectorAlive: (keyConnectorUrl: string) => Promise<void>;
|
||||||
}
|
}
|
||||||
|
@ -1491,6 +1491,21 @@ export class ApiService implements ApiServiceAbstraction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getKeyConnectorAlive(keyConnectorUrl: string) {
|
||||||
|
const response = await this.fetch(new Request(keyConnectorUrl + '/alive', {
|
||||||
|
cache: 'no-store',
|
||||||
|
method: 'GET',
|
||||||
|
headers: new Headers({
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (response.status !== 200) {
|
||||||
|
const error = await this.handleError(response, false, true);
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user