From 6d9b9cb9f362e54beb4bf2288b234d14f33b2e51 Mon Sep 17 00:00:00 2001 From: Lam Wei Li Date: Sun, 18 Sep 2022 18:09:39 +0800 Subject: [PATCH] fix(TestAgent): attach cookies to agent after plugin is used following superagent: PR: https://github.com/visionmedia/superagent/pull/1556 commit: https://github.com/visionmedia/superagent/commit/4babc5d6ac7a7c28fb829697eb02e3f7d72f2b1c --- lib/agent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/agent.js b/lib/agent.js index 0afb7c7..8adf984 100644 --- a/lib/agent.js +++ b/lib/agent.js @@ -55,8 +55,8 @@ methods.forEach(function(method) { 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); this._setDefaults(req); + this._attachCookies(req); return req; };