Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 6dcce85

Browse files
committed
fix(@nguniversal/common): handle cookies with localhost domain as path
`tough-cookie` which is a dependency of JSDOM did a breaking change in version 4.1 which requires special handling for cookies in localhost. See: salesforce/tough-cookie#246
1 parent 3b6264e commit 6dcce85

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/common/clover/server/src/server-engine.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
ɵNGRenderModeAPI as NGRenderModeAPI,
1212
} from '@nguniversal/common/clover';
1313
import * as fs from 'fs';
14-
import { JSDOM } from 'jsdom';
14+
import { CookieJar, JSDOM } from 'jsdom';
1515
import * as path from 'path';
1616
import { URL } from 'url';
1717
import { CustomResourceLoader } from './custom-resource-loader';
@@ -77,6 +77,9 @@ export class Engine {
7777
resources: customResourceLoader,
7878
url: options.url,
7979
referrer: options.headers?.referrer as string | undefined,
80+
cookieJar: new CookieJar(undefined, {
81+
allowSpecialUseDomain: true,
82+
}),
8083
beforeParse: (window) => {
8184
augmentWindowWithStubs(window);
8285
window.ngRenderMode = true;

0 commit comments

Comments
 (0)