Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tough-cookie from 4.0.0 to 4.1.2 #2184

Merged
merged 1 commit into from
Dec 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"tempy": "^3.0.0",
"then-busboy": "^5.2.1",
"to-readable-stream": "^3.0.0",
"tough-cookie": "4.0.0",
"tough-cookie": "4.1.2",
"ts-node": "^10.8.2",
"type-fest": "^3.0.0",
"typescript": "~4.8.2",
Expand Down
6 changes: 3 additions & 3 deletions test/cookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ test('cookies doesn\'t break on redirects', withServer, async (t, server, got) =

test('throws on invalid cookies', withServer, async (t, server, got) => {
server.get('/', (_request, response) => {
response.setHeader('set-cookie', 'hello=world; domain=localhost');
response.setHeader('set-cookie', 'invalid cookie; domain=localhost');
response.end();
});

const cookieJar = new toughCookie.CookieJar();

await t.throwsAsync(got({cookieJar}), {
instanceOf: RequestError,
message: 'Cookie has domain set to a public suffix',
message: 'Cookie failed to parse',
});
});

test('does not throw on invalid cookies when options.ignoreInvalidCookies is set', withServer, async (t, server, got) => {
server.get('/', (_request, response) => {
response.setHeader('set-cookie', 'hello=world; domain=localhost');
response.setHeader('set-cookie', 'invalid cookie; domain=localhost');
response.end();
});

Expand Down