mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
[PM-814] Breach Report Escape Characters (#16264)
* encode username for uri and add spec * verify response from getHibpBreach method * test/validate for BreachAccountResponse type and length instead of mock response
This commit is contained in:
@@ -1434,7 +1434,8 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
// HIBP APIs
|
||||
|
||||
async getHibpBreach(username: string): Promise<BreachAccountResponse[]> {
|
||||
const r = await this.send("GET", "/hibp/breach?username=" + username, null, true, true);
|
||||
const encodedUsername = encodeURIComponent(username);
|
||||
const r = await this.send("GET", "/hibp/breach?username=" + encodedUsername, null, true, true);
|
||||
return r.map((a: any) => new BreachAccountResponse(a));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user