Comparing version 0.1.0 to 0.1.1
@@ -17,3 +17,8 @@ | ||
if (opt.maxAge) pairs.push('Max-Age=' + opt.maxAge); | ||
if (null != opt.maxAge) { | ||
var maxAge = opt.maxAge - 0; | ||
if (isNaN(maxAge)) throw new Error('maxAge should be a Number'); | ||
pairs.push('Max-Age=' + maxAge); | ||
} | ||
if (opt.domain) pairs.push('Domain=' + opt.domain); | ||
@@ -35,3 +40,3 @@ if (opt.path) pairs.push('Path=' + opt.path); | ||
var obj = {} | ||
var pairs = str.split(/[;,] */); | ||
var pairs = str.split(/; */); | ||
var dec = opt.decode || decode; | ||
@@ -38,0 +43,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "cookie parsing and serialization", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -1,2 +0,2 @@ | ||
# cookie [![Build Status](https://secure.travis-ci.org/shtylman/node-cookie.png?branch=master)](http://travis-ci.org/shtylman/node-cookie) # | ||
# cookie [![Build Status](https://secure.travis-ci.org/defunctzombie/node-cookie.png?branch=master)](http://travis-ci.org/defunctzombie/node-cookie) # | ||
@@ -3,0 +3,0 @@ cookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers. |
@@ -44,2 +44,9 @@ | ||
})); | ||
}); | ||
test('dates', function() { | ||
assert.deepEqual({ priority: 'true', Path: '/', expires: 'Wed, 29 Jan 2014 17:43:25 GMT' }, | ||
cookie.parse('priority=true; expires=Wed, 29 Jan 2014 17:43:25 GMT; Path=/',{ | ||
decode: function(value) { return value; } | ||
})); | ||
}) |
@@ -45,2 +45,6 @@ // builtin | ||
})); | ||
assert.equal('foo=bar; Max-Age=0', cookie.serialize('foo', 'bar', { | ||
maxAge: 0 | ||
})); | ||
}); | ||
@@ -47,0 +51,0 @@ |
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
8130
154