You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: allow set cookies with localhost
Adding more tests to cover the breaking use cases noted in #246.
e.g.;.
* `new CookieJar().setCookieSync("settingThisShouldPass=true; Domain=localhost; Path=/;", "http://localhost")`
Also modifies the assertion for a test introduced in #221 that may be incorrect.
* fix: allow set cookies with localhost
Adding more tests to cover the breaking use cases noted in #246.
e.g.;.
* `new CookieJar().setCookieSync("settingThisShouldPass=true; Domain=localhost; Path=/;", "http://localhost")`
Also modifies the assertion for a test introduced in #221 that may be incorrect.
* fix: allow set cookies with localhost
Adding more tests to cover the breaking use cases noted in #246.
e.g.;.
* `new CookieJar().setCookieSync("settingThisShouldPass=true; Domain=localhost; Path=/;", "http://localhost")`
Also modifies the assertion for a test introduced in #221 that may be incorrect.
* fix: allow set cookies with localhost
updated CHANGELOG.md to point to the releases page since changelogs are auto-generated now.
* Release v4.1.2
All notable changes to this project will be documented in this file.
4
-
5
-
## 4.X.X
6
-
7
-
### Minor Changes
8
-
- Added parameter checking to setCookie so as to error out when no URL was passed in
9
-
10
-
## X.Y.Z
11
-
12
-
### Minor Changes
13
-
- Added loose mode to the serialized options. Now a serialized cookie jar with loose mode enabled will honor that flag when deserialized.
14
-
- Added allowSpecialUseDomain and prefixSecurity to the serialized options. Now any options accepted passed in to the cookie jar will be honored when serialized and deserialized.
15
-
- Added handling of IPv6 host names so that they would work with tough cookie.
16
-
17
-
## 4.0.0
18
-
19
-
### Breaking Changes (Major Version)
20
-
21
-
- Modernized JS Syntax
22
-
- Use ESLint and Prettier to apply consistent, modern formatting (add dependency on `universalify`, `eslint` and `prettier`)
23
-
- Upgraded version dependencies for `psl` and `async`
24
-
- Re-order parameters for `findCookies()` - callback fn has to be last in order to comply with `universalify`
25
-
- Use Classes instead of function prototypes to define classes
26
-
- Might break people using `.call()` to do inheritance using function prototypes
27
-
28
-
### Minor Changes
29
-
- SameSite cookie support
30
-
- Cookie prefix support
31
-
- Support for promises
32
-
- '.local' support
33
-
- Numerous bug fixes!
34
-
35
-
3
+
All notable changes to this project can be found at on the [Releases](https://github.com/salesforce/tough-cookie/releases)
Copy file name to clipboardExpand all lines: test/regression_test.js
+19-5Lines changed: 19 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -197,20 +197,34 @@ vows
197
197
returncookieJar.setCookieSync(
198
198
"a=b; Domain=localhost",
199
199
"http://localhost"
200
-
);// when domain set to 'localhost', will throw 'Error: Cookie has domain set to a public suffix'
200
+
);// Users are free to use localhost names as they would any other domain names. [RFC 6761, Sec. 6.3.1]
201
201
},
202
202
works: function(err,c){
203
-
// localhost as domain throws an error, cookie should not be defined
204
-
assert.instanceOf(err,Error);
205
-
assert.isUndefined(c);
203
+
assert.instanceOf(c,Cookie);
204
+
assert.match(c,/Domain=localhost/);
205
+
}
206
+
}
207
+
},
208
+
{
209
+
"setCookie with localhost (localhost. domain) (GH-215)": {
210
+
topic: function(){
211
+
constcookieJar=newCookieJar();
212
+
returncookieJar.setCookieSync(
213
+
"a=b; Domain=localhost.",
214
+
"http://localhost."
215
+
);// Users are free to use localhost names as they would any other domain names. [RFC 6761, Sec. 6.3.1]
216
+
},
217
+
works: function(err,c){
218
+
assert.instanceOf(c,Cookie);
219
+
assert.match(c,/Domain=localhost/);
206
220
}
207
221
}
208
222
},
209
223
{
210
224
"setCookie with localhost (GH-215) (null domain)": {
211
225
topic: function(){
212
226
constcookieJar=newCookieJar();
213
-
returncookieJar.setCookieSync("a=b; Domain=","http://localhost");// when domain set to 'localhost', will throw 'Error: Cookie has domain set to a public suffix'
0 commit comments