From 56b72bbd2c2924ff6d89a7004282142d86ead8fa Mon Sep 17 00:00:00 2001 From: Xianming Zhong Date: Sat, 15 Feb 2020 13:41:08 +0800 Subject: [PATCH] Compatible with follow-redirect aborts the request (#2689) * Compatible with follow-redirect aborts the request * Use the error code --- lib/adapters/http.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/adapters/http.js b/lib/adapters/http.js index 16dad12..8b968e0 100755 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -240,7 +240,7 @@ module.exports = function httpAdapter(config) { // Handle errors req.on('error', function handleRequestError(err) { - if (req.aborted) return; + if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; reject(enhanceError(err, config, null, req)); }); diff --git a/package.json b/package.json index 36302bf..cabd9e4 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "unpkg": "dist/axios.min.js", "typings": "./index.d.ts", "dependencies": { - "follow-redirects": "1.5.10" + "follow-redirects": "^1.10.0" }, "bundlesize": [ {