diff --git a/History.md b/History.md index 9f211eb..7f96219 100644 --- a/History.md +++ b/History.md @@ -6,6 +6,7 @@ * add req.host= * add: context.throw supports Error instances * update co + * update cookies 0.2.1 / 2013-12-30 ================== diff --git a/lib/application.js b/lib/application.js index 40790a2..4166b94 100644 --- a/lib/application.js +++ b/lib/application.js @@ -10,7 +10,6 @@ var context = require('./context'); var request = require('./request'); var response = require('./response'); var Cookies = require('cookies'); -var Keygrip = require('keygrip'); var accepts = require('accepts'); var assert = require('assert'); var http = require('http'); @@ -121,10 +120,10 @@ app.callback = function(){ */ app.__defineSetter__('keys', function(keys){ - var ok = Array.isArray(keys) || keys instanceof Keygrip; + var ok = keys && (Array.isArray(keys) + || (keys.constructor && keys.constructor.name === 'Keygrip')); debug('keys %j', keys); if (!ok) throw new TypeError('app.keys must be an array or Keygrip'); - if (!(keys instanceof Keygrip)) keys = new Keygrip(keys); this._keys = keys; }); diff --git a/package.json b/package.json index dc970fc..bc466ab 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,7 @@ "mime": "~1.2.11", "fresh": "~0.2.1", "koa-compose": "~2.2.0", - "cookies": "~0.3.7", - "keygrip": "~1.0.0", + "cookies": "~0.4.0", "delegates": "0.0.3" }, "devDependencies": {