Skip to content

Commit

Permalink
Update tough-cookie dependency (#2184)
Browse files Browse the repository at this point in the history
  • Loading branch information
colincasey committed Dec 4, 2022
1 parent fd75360 commit 979272e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
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
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

0 comments on commit 979272e

Please sign in to comment.