Skip to content

Commit

Permalink
fix(@nguniversal/common): handle cookies with localhost domain as path
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
alan-agius4 committed Aug 26, 2022
1 parent 3b6264e commit 6dcce85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/common/clover/server/src/server-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ɵNGRenderModeAPI as NGRenderModeAPI,
} from '@nguniversal/common/clover';
import * as fs from 'fs';
import { JSDOM } from 'jsdom';
import { CookieJar, JSDOM } from 'jsdom';
import * as path from 'path';
import { URL } from 'url';
import { CustomResourceLoader } from './custom-resource-loader';
Expand Down Expand Up @@ -77,6 +77,9 @@ export class Engine {
resources: customResourceLoader,
url: options.url,
referrer: options.headers?.referrer as string | undefined,
cookieJar: new CookieJar(undefined, {
allowSpecialUseDomain: true,
}),
beforeParse: (window) => {
augmentWindowWithStubs(window);
window.ngRenderMode = true;
Expand Down

0 comments on commit 6dcce85

Please sign in to comment.