Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "biskviit", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Yet another module for http cookie handling", | ||
@@ -33,3 +33,6 @@ "main": "lib/biskviit.js", | ||
"psl": "^1.1.7" | ||
}, | ||
"engines": { | ||
"node": ">=1.0.0" | ||
} | ||
} | ||
} |
# biskviit | ||
Yet another node module for handling http cookies. This module parses `Set-Cookie` header, stores the data to memory and returns valid value for `Cookie` header once needed based on the stored cookie data. | ||
> **NB** Requires iojs or Node v4+ to support some ES6 features used by this module. Might work with older Node versions as well but not tested | ||
## Usage | ||
@@ -5,0 +7,0 @@ |
@@ -186,2 +186,16 @@ 'use strict'; | ||
it('should check if a cookie matches particular domain and path', function() { | ||
var cookie = { | ||
name: 'zzz', | ||
value: 'abc', | ||
path: '/def', | ||
expires: new Date(Date.now() + 10000), | ||
domain: 'example.com', | ||
secure: false, | ||
httponly: false | ||
}; | ||
expect(biskviit.match(cookie, 'http://example.com/def/')).to.be.true; | ||
expect(biskviit.match(cookie, 'http://example.com/bef/')).to.be.false; | ||
}); | ||
it('should check if a cookie is secure', function() { | ||
@@ -316,3 +330,3 @@ var cookie = { | ||
// long | ||
biskviit.set('SSID=Ap4P….GTEq; Domain=foo.com; Path=/; Expires=Wed, 13 Jan 2021 22:23:01 GMT; Secure; HttpOnly', 'https://foo.com/'); | ||
biskviit.set('SSID=Ap4P….GTEq; Domain=foo.com; Path=/test; Expires=Wed, 13 Jan 2021 22:23:01 GMT; Secure; HttpOnly', 'https://foo.com/'); | ||
// subdomains | ||
@@ -341,3 +355,3 @@ biskviit.set('SSID=Ap4P….GTEq; Domain=.foo.com; Path=/; Expires=Wed, 13 Jan 2021 22:23:01 GMT; Secure; HttpOnly', 'https://www.foo.com/'); | ||
domain: 'foo.com', | ||
path: '/', | ||
path: '/test', | ||
secure: true, | ||
@@ -344,0 +358,0 @@ httponly: true |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25617
594
98