urllib 2.37.2 → 2.37.3

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/History.md CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ 2.37.3 / 2021-07-05
3
+ ==================
4
+
5
+ **fixes**
6
+ * [[`b730a6c`](http://github.com/node-modules/urllib/commit/b730a6cdc0465bea1c08d50bfa3b5e95bd17b31f)] - fix: 🐛 redirect status code (#363) (Hongcai Deng <<admin@dhchouse.com>>)
7
+
2
8
  2.37.2 / 2021-06-07
3
9
  ==================
4
10
 
package/lib/urllib.js CHANGED
@@ -602,15 +602,14 @@ function requestWithCallback(url, args, callback) {
602
602
  timing.contentDownload = requestUseTime;
603
603
  }
604
604
 
605
- var headers = {};
606
- if (res && res.headers) {
607
- headers = res.headers;
608
- }
605
+ var headers = res && res.headers || {};
606
+ var resStatusCode = res && res.statusCode || statusCode;
607
+ var resStatusMessage = res && res.statusMessage || statusMessage;
609
608
 
610
609
  return {
611
- status: statusCode,
612
- statusCode: statusCode,
613
- statusMessage: statusMessage,
610
+ status: resStatusCode,
611
+ statusCode: resStatusCode,
612
+ statusMessage: resStatusMessage,
614
613
  headers: headers,
615
614
  size: responseSize,
616
615
  aborted: responseAborted,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "urllib",
3
- "version": "2.37.2",
3
+ "version": "2.37.3",
4
4
  "description": "Help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirections, cookies and more.",
5
5
  "keywords": [
6
6
  "urllib",