diff --git a/lib/agent.js b/lib/agent.js index ff617eda..606b2ebb 100644 --- a/lib/agent.js +++ b/lib/agent.js @@ -42,10 +42,10 @@ methods.forEach(function(method) { var req = new Test(this.app, method.toUpperCase(), url); req.ca(this._ca); - req.on('response', this.saveCookies.bind(this)); - req.on('redirect', this.saveCookies.bind(this)); - req.on('redirect', this.attachCookies.bind(this, req)); - this.attachCookies(req); + req.on('response', this._saveCookies.bind(this)); + req.on('redirect', this._saveCookies.bind(this)); + req.on('redirect', this._attachCookies.bind(this, req)); + this._attachCookies(req); return req; }; diff --git a/package.json b/package.json index d5ceac9b..23a9801a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "test": "eslint lib/**/*.js test/**/*.js && mocha --require should --reporter spec --check-leaks" }, "dependencies": { - "superagent": "^1.7.2", + "superagent": "^2.0.0", "methods": "1.x" }, "devDependencies": {