1
0
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:
Alex
2025-09-08 10:23:29 -04:00
committed by GitHub
parent b93602b09e
commit 3bc3bef50b
2 changed files with 25 additions and 1 deletions

View File

@@ -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));
}