@wiajs/request 3.0.23 → 3.0.25

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/request.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * wia request v3.0.23
2
+ * wia request v3.0.25
3
3
  * (c) 2022-2024 Sibyl Yu and contributors
4
4
  * Released under the MIT License.
5
5
  */
@@ -661,7 +661,7 @@ class Request extends stream.Duplex {
661
661
  for (const method of writeMethods) {
662
662
  // @ts-ignore
663
663
  m[method] = (a, b) => {
664
- log$1(method, {a, b});
664
+ // log(method, {a, b})
665
665
  // @ts-ignore
666
666
  m._currentRequest?.[method](a, b);
667
667
  };
@@ -765,7 +765,7 @@ class Request extends stream.Duplex {
765
765
  const httpModule = httpModules[protocol];
766
766
  if (!httpModule) throw TypeError(`Unsupported protocol: ${protocol}`)
767
767
 
768
- log$1({opt, protocol}, 'request');
768
+ // log({opt, protocol}, 'request')
769
769
  // Create the native request and set up its event handlers
770
770
  // @ts-ignore
771
771
  const req = httpModule.request(opt, m._onResponse);
@@ -1208,7 +1208,9 @@ class Request extends stream.Duplex {
1208
1208
 
1209
1209
  // Create the redirected request
1210
1210
  const redirectUrl = utils.resolveUrl(location, currentUrl);
1211
+
1211
1212
  log$1({redirectUrl}, 'redirecting to');
1213
+
1212
1214
  m._isRedirect = true;
1213
1215
  // 覆盖原 url 解析部分,包括 protocol、hostname、port等
1214
1216
  utils.spreadUrlObject(redirectUrl, m.opt);
package/dist/request.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * wia request v3.0.23
2
+ * wia request v3.0.25
3
3
  * (c) 2022-2024 Sibyl Yu and contributors
4
4
  * Released under the MIT License.
5
5
  */
@@ -658,7 +658,7 @@ class Request extends Duplex {
658
658
  for (const method of writeMethods) {
659
659
  // @ts-ignore
660
660
  m[method] = (a, b) => {
661
- log$1(method, {a, b});
661
+ // log(method, {a, b})
662
662
  // @ts-ignore
663
663
  m._currentRequest?.[method](a, b);
664
664
  };
@@ -762,7 +762,7 @@ class Request extends Duplex {
762
762
  const httpModule = httpModules[protocol];
763
763
  if (!httpModule) throw TypeError(`Unsupported protocol: ${protocol}`)
764
764
 
765
- log$1({opt, protocol}, 'request');
765
+ // log({opt, protocol}, 'request')
766
766
  // Create the native request and set up its event handlers
767
767
  // @ts-ignore
768
768
  const req = httpModule.request(opt, m._onResponse);
@@ -1205,7 +1205,9 @@ class Request extends Duplex {
1205
1205
 
1206
1206
  // Create the redirected request
1207
1207
  const redirectUrl = utils.resolveUrl(location, currentUrl);
1208
+
1208
1209
  log$1({redirectUrl}, 'redirecting to');
1210
+
1209
1211
  m._isRedirect = true;
1210
1212
  // 覆盖原 url 解析部分,包括 protocol、hostname、port等
1211
1213
  utils.spreadUrlObject(redirectUrl, m.opt);
package/lib/request.js CHANGED
@@ -174,10 +174,7 @@ const WriteAfterEndError = utils.createErrorType('ERR_STREAM_WRITE_AFTER_END', '
174
174
  for (const method of writeMethods){
175
175
  // @ts-ignore
176
176
  m[method] = (a, b)=>{
177
- log(method, {
178
- a,
179
- b
180
- });
177
+ // log(method, {a, b})
181
178
  // @ts-ignore
182
179
  m._currentRequest?.[method](a, b);
183
180
  };
@@ -259,10 +256,7 @@ const WriteAfterEndError = utils.createErrorType('ERR_STREAM_WRITE_AFTER_END', '
259
256
  }
260
257
  const httpModule = httpModules[protocol];
261
258
  if (!httpModule) throw TypeError(`Unsupported protocol: ${protocol}`);
262
- log({
263
- opt,
264
- protocol
265
- }, 'request');
259
+ // log({opt, protocol}, 'request')
266
260
  // Create the native request and set up its event handlers
267
261
  // @ts-ignore
268
262
  const req = httpModule.request(opt, m._onResponse);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wiajs/request",
3
3
  "description": "Stream HTTP request client.",
4
4
  "keywords": ["http", "simple", "util", "utility"],
5
- "version": "3.0.23",
5
+ "version": "3.0.25",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "types": "types/index.d.ts",