Skip to content

Commit eaa0002

Browse files
authored
fix: bump limit to 32K
1 parent a9a320c commit eaa0002

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cookiejar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464

6565
var cookie_str_splitter = /[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;
6666
Cookie.prototype.parse = function parse(str, request_domain, request_path) {
67-
if ( str.length > 4096 ) {
68-
console.warn("Cookie too long for parsing (>4096 characters)");
67+
if ( str.length > 32768 ) {
68+
console.warn("Cookie too long for parsing (>32768 characters)");
6969
return;
7070
}
7171

tests/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ assert.equal(cookie.path, "/");
6868
assert.deepEqual(cookie, new Cookie("a=1;domain=.test.com;path=/"));
6969

7070
// ensure cookies that are too long are not parsed to avoid any issues with DoS inputs
71-
var too_long_cookie = new Cookie( "foo=" + "blah".repeat( 2000 ) );
71+
var too_long_cookie = new Cookie( "foo=" + "blah".repeat( 10000 ) );
7272
assert.equal(too_long_cookie, undefined);
7373

7474
// Test request_path and request_domain

0 commit comments

Comments
 (0)