urllib 3.15.0 → 3.16.0
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 +1 -0
- package/package.json +2 -2
- package/src/HttpClient.ts +3 -1
- package/src/Request.ts +2 -1
- package/src/cjs/HttpClient.js +4 -1
- package/src/cjs/Request.d.ts +2 -0
- package/src/esm/HttpClient.js +4 -1
- package/src/esm/Request.d.ts +2 -0
package/README.md
CHANGED
@@ -75,6 +75,7 @@ console.log('status: %s, body size: %d, headers: %j', res.status, data.length, r
|
|
75
75
|
- ***compressed*** Boolean - Accept `gzip, br` response content and auto decode it, default is `false`.
|
76
76
|
- ***timing*** Boolean - Enable timing or not, default is `false`.
|
77
77
|
- ***socketPath*** String | null - request a unix socket service, default is `null`.
|
78
|
+
- ***highWaterMark*** Number - default is `67108864`, 64 KiB.
|
78
79
|
|
79
80
|
#### Options: `options.data`
|
80
81
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "urllib",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.16.0",
|
4
4
|
"publishConfig": {
|
5
5
|
"tag": "latest"
|
6
6
|
},
|
@@ -73,7 +73,7 @@
|
|
73
73
|
"@types/busboy": "^1.5.0",
|
74
74
|
"@types/default-user-agent": "^1.0.0",
|
75
75
|
"@types/mime-types": "^2.1.1",
|
76
|
-
"@types/node": "^
|
76
|
+
"@types/node": "^20.2.1",
|
77
77
|
"@types/pump": "^1.1.1",
|
78
78
|
"@types/selfsigned": "^2.0.1",
|
79
79
|
"@types/tar-stream": "^2.2.2",
|
package/src/HttpClient.ts
CHANGED
@@ -316,10 +316,12 @@ export class HttpClient extends EventEmitter {
|
|
316
316
|
opaque: internalOpaque,
|
317
317
|
dispatcher: args.dispatcher ?? this.#dispatcher,
|
318
318
|
};
|
319
|
+
if (typeof args.highWaterMark === 'number') {
|
320
|
+
requestOptions.highWaterMark = args.highWaterMark;
|
321
|
+
}
|
319
322
|
if (typeof args.reset === 'boolean') {
|
320
323
|
requestOptions.reset = args.reset;
|
321
324
|
}
|
322
|
-
|
323
325
|
if (args.followRedirect === false) {
|
324
326
|
requestOptions.maxRedirections = 0;
|
325
327
|
}
|
package/src/Request.ts
CHANGED
@@ -125,11 +125,12 @@ export type RequestOptions = {
|
|
125
125
|
* request dispatcher, default is getGlobalDispatcher()
|
126
126
|
*/
|
127
127
|
dispatcher?: Dispatcher;
|
128
|
-
|
129
128
|
/**
|
130
129
|
* unix domain socket file path
|
131
130
|
*/
|
132
131
|
socketPath?: string | null;
|
133
132
|
/** Whether the request should stablish a keep-alive or not. Default `undefined` */
|
134
133
|
reset?: boolean;
|
134
|
+
/** Default: `64 KiB` */
|
135
|
+
highWaterMark?: number;
|
135
136
|
};
|
package/src/cjs/HttpClient.js
CHANGED
@@ -69,7 +69,7 @@ class HttpClientRequestTimeoutError extends Error {
|
|
69
69
|
Error.captureStackTrace(this, this.constructor);
|
70
70
|
}
|
71
71
|
}
|
72
|
-
exports.HEADER_USER_AGENT = (0, default_user_agent_1.default)('node-urllib', '3.
|
72
|
+
exports.HEADER_USER_AGENT = (0, default_user_agent_1.default)('node-urllib', '3.16.0');
|
73
73
|
function getFileName(stream) {
|
74
74
|
const filePath = stream.path;
|
75
75
|
if (filePath) {
|
@@ -253,6 +253,9 @@ class HttpClient extends node_events_1.EventEmitter {
|
|
253
253
|
opaque: internalOpaque,
|
254
254
|
dispatcher: args.dispatcher ?? this.#dispatcher,
|
255
255
|
};
|
256
|
+
if (typeof args.highWaterMark === 'number') {
|
257
|
+
requestOptions.highWaterMark = args.highWaterMark;
|
258
|
+
}
|
256
259
|
if (typeof args.reset === 'boolean') {
|
257
260
|
requestOptions.reset = args.reset;
|
258
261
|
}
|
package/src/cjs/Request.d.ts
CHANGED
package/src/esm/HttpClient.js
CHANGED
@@ -63,7 +63,7 @@ class HttpClientRequestTimeoutError extends Error {
|
|
63
63
|
Error.captureStackTrace(this, this.constructor);
|
64
64
|
}
|
65
65
|
}
|
66
|
-
export const HEADER_USER_AGENT = createUserAgent('node-urllib', '3.
|
66
|
+
export const HEADER_USER_AGENT = createUserAgent('node-urllib', '3.16.0');
|
67
67
|
function getFileName(stream) {
|
68
68
|
const filePath = stream.path;
|
69
69
|
if (filePath) {
|
@@ -247,6 +247,9 @@ export class HttpClient extends EventEmitter {
|
|
247
247
|
opaque: internalOpaque,
|
248
248
|
dispatcher: args.dispatcher ?? this.#dispatcher,
|
249
249
|
};
|
250
|
+
if (typeof args.highWaterMark === 'number') {
|
251
|
+
requestOptions.highWaterMark = args.highWaterMark;
|
252
|
+
}
|
250
253
|
if (typeof args.reset === 'boolean') {
|
251
254
|
requestOptions.reset = args.reset;
|
252
255
|
}
|
package/src/esm/Request.d.ts
CHANGED