urllib 3.19.2 → 3.19.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/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  [download-url]: https://npmjs.org/package/urllib
17
17
 
18
18
  Request HTTP URLs in a complex world — basic
19
- and digest authentication, redirections, cookies, timeout and more.
19
+ and digest authentication, redirections, timeout and more.
20
20
 
21
21
  ## Install
22
22
 
@@ -73,7 +73,7 @@ class HttpClientRequestTimeoutError extends Error {
73
73
  Error.captureStackTrace(this, this.constructor);
74
74
  }
75
75
  }
76
- exports.HEADER_USER_AGENT = (0, default_user_agent_1.default)('node-urllib', '3.19.2');
76
+ exports.HEADER_USER_AGENT = (0, default_user_agent_1.default)('node-urllib', '3.19.3');
77
77
  function getFileName(stream) {
78
78
  const filePath = stream.path;
79
79
  if (filePath) {
@@ -126,7 +126,8 @@ class HttpClient extends node_events_1.EventEmitter {
126
126
  requestUrl = new URL((0, node_url_1.format)(url));
127
127
  }
128
128
  else {
129
- requestUrl = url;
129
+ // or even if not, we clone to avoid mutating it
130
+ requestUrl = new URL(url.toString());
130
131
  }
131
132
  }
132
133
  const method = (options?.method ?? 'GET').toUpperCase();
@@ -67,7 +67,7 @@ class HttpClientRequestTimeoutError extends Error {
67
67
  Error.captureStackTrace(this, this.constructor);
68
68
  }
69
69
  }
70
- export const HEADER_USER_AGENT = createUserAgent('node-urllib', '3.19.2');
70
+ export const HEADER_USER_AGENT = createUserAgent('node-urllib', '3.19.3');
71
71
  function getFileName(stream) {
72
72
  const filePath = stream.path;
73
73
  if (filePath) {
@@ -120,7 +120,8 @@ export class HttpClient extends EventEmitter {
120
120
  requestUrl = new URL(urlFormat(url));
121
121
  }
122
122
  else {
123
- requestUrl = url;
123
+ // or even if not, we clone to avoid mutating it
124
+ requestUrl = new URL(url.toString());
124
125
  }
125
126
  }
126
127
  const method = (options?.method ?? 'GET').toUpperCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "urllib",
3
- "version": "3.19.2",
3
+ "version": "3.19.3",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },
package/src/HttpClient.ts CHANGED
@@ -201,7 +201,8 @@ export class HttpClient extends EventEmitter {
201
201
  // url maybe url.parse(url) object in urllib2
202
202
  requestUrl = new URL(urlFormat(url));
203
203
  } else {
204
- requestUrl = url;
204
+ // or even if not, we clone to avoid mutating it
205
+ requestUrl = new URL(url.toString());
205
206
  }
206
207
  }
207
208