1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-27 14:53:44 +00:00

Save fallback response

This commit is contained in:
Leslie Tilton
2026-01-23 12:24:28 -06:00
parent db390aaa25
commit a90d46a371

View File

@@ -288,6 +288,18 @@ export class PhishingDataService {
);
// Try fallback URL
return from(this.apiService.nativeFetch(new Request(resource.fallbackUrl))).pipe(
switchMap((fallbackResponse) => {
if (!fallbackResponse.ok || !fallbackResponse.body) {
return throwError(
() =>
new Error(
`[PhishingDataService] Fallback fetch failed: ${fallbackResponse.status}, ${fallbackResponse.statusText}`,
),
);
}
return from(this.indexedDbService.saveUrlsFromStream(fallbackResponse.body));
}),
catchError((fallbackError: unknown) => {
this.logService.error(`[PhishingDataService] Fallback source failed`);
return throwError(() => fallbackError);