mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(service-worker): remove unnecessary cast in mock redirect check
Use the typed Response.redirected property directly in the service-worker test mock instead of casting to any.
This commit is contained in:
@@ -166,7 +166,7 @@ export class MockServerState {
|
||||
const url = req.url.split('?')[0];
|
||||
if (this.resources.has(url)) {
|
||||
const response = this.resources.get(url)!.clone();
|
||||
if ((response as any).redirected && req.redirect === 'error') {
|
||||
if (response.redirected && req.redirect === 'error') {
|
||||
throw new Error('Redirect disallowed by request policy.');
|
||||
}
|
||||
return response;
|
||||
|
||||
Reference in New Issue
Block a user