ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.59k stars 1.33k forks source link

fix: attach cookies to agent after plugin is used #1556

Closed iuioiua closed 4 years ago

iuioiua commented 4 years ago

This fixes the issue whereby if request.url is modified in a plugin for an agent (eg. superagent-prefix), cookies are not preserved across different requests, using that agent (see issue #1164).

This is fixed by simply executing agent._attachCookies() after agent._setDefaults().

Note: this is my first pull request ever.

niftylettuce commented 4 years ago

v5.3.0 published to npm and GitHub releases page with changelog