@wiajs/req 1.7.15 → 1.7.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node/req.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @wia/req v1.7.13
2
+ * @wia/req v1.7.17
3
3
  * (c) 2024 Sibyl Yu, Matt Zabriskie and contributors
4
4
  * Released under the MIT License.
5
5
  */
@@ -2908,17 +2908,18 @@ class HttpAdapter {
2908
2908
  path,
2909
2909
  method,
2910
2910
  headers: headers.toJSON(),
2911
- // agents: {http: config.httpAgent, https: config.httpsAgent},
2912
- agents,
2913
2911
  auth,
2914
2912
  protocol,
2915
2913
  family,
2916
2914
  beforeRedirect: dispatchBeforeRedirect,
2917
2915
  beforeRedirects: {},
2918
- http,
2919
- https,
2920
2916
  };
2921
2917
 
2918
+ if (config.httpAgent) options.agents = {http: config.httpAgent};
2919
+ if (config.httpsAgent) options.agents.https = config.httpAgent;
2920
+ // ! 配置了 agent,使用Agent,否则使用缺省 agent
2921
+ if (config.agent) options.agents = new agent.Agent(config.agent);
2922
+
2922
2923
  // cacheable-lookup integration hotfix
2923
2924
  if (!utils$1.isUndefined(lookup)) options.lookup = lookup;
2924
2925
 
@@ -2928,8 +2929,6 @@ class HttpAdapter {
2928
2929
  ? parsed.hostname.slice(1, -1)
2929
2930
  : parsed.hostname;
2930
2931
  options.port = parsed.port;
2931
- // ! proxy 配置了 agent,否则使用缺省 agent
2932
- if (config.agent) options.agents = new agent.Agent(config.agent);
2933
2932
  }
2934
2933
 
2935
2934
  // 执行请求的具体对象
package/dist/req.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @wia/req v1.7.13
2
+ * @wia/req v1.7.17
3
3
  * (c) 2024 Sibyl Yu, Matt Zabriskie and contributors
4
4
  * Released under the MIT License.
5
5
  */
package/dist/req.min.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @wia/req v1.7.13
2
+ * @wia/req v1.7.17
3
3
  * (c) 2024 Sibyl Yu, Matt Zabriskie and contributors
4
4
  * Released under the MIT License.
5
5
  */
package/dist/web/req.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @wia/req v1.7.13
2
+ * @wia/req v1.7.17
3
3
  * (c) 2024 Sibyl Yu, Matt Zabriskie and contributors
4
4
  * Released under the MIT License.
5
5
  */
package/dist/web/req.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @wia/req v1.7.13
2
+ * @wia/req v1.7.17
3
3
  * (c) 2024 Sibyl Yu, Matt Zabriskie and contributors
4
4
  * Released under the MIT License.
5
5
  */