8000 test(service-worker): fix default value of `Request#credentials` (`om… · angular/angular@f5cfbe0 · GitHub
[go: up one dir, main page]

Skip to content

Commit f5cfbe0

Browse files
gkalpakAndrewKushnir
authored andcommitted
test(service-worker): fix default value of Request#credentials (omit --> same-origin) (#47260)
Previously, the default value of `MockRequest#credentials` (used in testing) was set to `omit`. This was different than the default value used in browsers, which is `same-origin` (see [Request docs on MDN][1]) and could lead to incorrect test results. This commit changes the default value for `credentials` to `same-origin` to match what would happen in the browser. [1]: https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials PR Close #47260
1 parent 28d3350 commit f5cfbe0

File tree

1 file changed

+1
-1
lines changed
  • packages/service-worker/worker/testing

1 file changed

+1
-1
lines changed

packages/service-worker/worker/testing/fetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class MockRequest extends MockBody implements Request {
100100
readonly isHistoryNavigation: boolean = false;
101101
readonly isReloadNavigation: boolean = false;
102102
readonly cache: RequestCache = 'default';
103-
readonly credentials: RequestCredentials = 'omit';
103+
readonly credentials: RequestCredentials = 'same-origin';
104104
readonly destination: RequestDestination = 'document';
105105
readonly headers: Headers = new MockHeaders();
106106
readonly integrity: string = '';

0 commit comments

Comments
 (0)
0