image-optimizer-node 0.1.0 → 0.1.1
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/cli.cjs +7 -4
- package/dist/cli.js +7 -4
- package/dist/index.cjs +7 -4
- package/dist/index.js +7 -4
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -408,7 +408,7 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
408
408
|
);
|
|
409
409
|
});
|
|
410
410
|
connectReq.on("error", reject);
|
|
411
|
-
connectReq.on("connect", (connectRes, socket) => {
|
|
411
|
+
connectReq.on("connect", (connectRes, socket, head) => {
|
|
412
412
|
if (connectRes.statusCode !== 200) {
|
|
413
413
|
socket.destroy();
|
|
414
414
|
reject(
|
|
@@ -418,7 +418,11 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
418
418
|
);
|
|
419
419
|
return;
|
|
420
420
|
}
|
|
421
|
-
|
|
421
|
+
if (head && head.length > 0) {
|
|
422
|
+
socket.unshift(head);
|
|
423
|
+
}
|
|
424
|
+
const agent = new import_node_https.default.Agent({ keepAlive: false });
|
|
425
|
+
agent.createConnection = () => import_node_tls.default.connect({
|
|
422
426
|
socket,
|
|
423
427
|
servername: targetUrl.hostname
|
|
424
428
|
});
|
|
@@ -429,8 +433,7 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
429
433
|
path: `${targetUrl.pathname}${targetUrl.search}`,
|
|
430
434
|
method,
|
|
431
435
|
headers,
|
|
432
|
-
agent
|
|
433
|
-
createConnection: () => tlsSocket
|
|
436
|
+
agent
|
|
434
437
|
},
|
|
435
438
|
handleIncoming
|
|
436
439
|
);
|
package/dist/cli.js
CHANGED
|
@@ -381,7 +381,7 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
381
381
|
);
|
|
382
382
|
});
|
|
383
383
|
connectReq.on("error", reject);
|
|
384
|
-
connectReq.on("connect", (connectRes, socket) => {
|
|
384
|
+
connectReq.on("connect", (connectRes, socket, head) => {
|
|
385
385
|
if (connectRes.statusCode !== 200) {
|
|
386
386
|
socket.destroy();
|
|
387
387
|
reject(
|
|
@@ -391,7 +391,11 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
391
391
|
);
|
|
392
392
|
return;
|
|
393
393
|
}
|
|
394
|
-
|
|
394
|
+
if (head && head.length > 0) {
|
|
395
|
+
socket.unshift(head);
|
|
396
|
+
}
|
|
397
|
+
const agent = new https.Agent({ keepAlive: false });
|
|
398
|
+
agent.createConnection = () => tls.connect({
|
|
395
399
|
socket,
|
|
396
400
|
servername: targetUrl.hostname
|
|
397
401
|
});
|
|
@@ -402,8 +406,7 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
402
406
|
path: `${targetUrl.pathname}${targetUrl.search}`,
|
|
403
407
|
method,
|
|
404
408
|
headers,
|
|
405
|
-
agent
|
|
406
|
-
createConnection: () => tlsSocket
|
|
409
|
+
agent
|
|
407
410
|
},
|
|
408
411
|
handleIncoming
|
|
409
412
|
);
|
package/dist/index.cjs
CHANGED
|
@@ -912,7 +912,7 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
912
912
|
);
|
|
913
913
|
});
|
|
914
914
|
connectReq.on("error", reject);
|
|
915
|
-
connectReq.on("connect", (connectRes, socket) => {
|
|
915
|
+
connectReq.on("connect", (connectRes, socket, head) => {
|
|
916
916
|
if (connectRes.statusCode !== 200) {
|
|
917
917
|
socket.destroy();
|
|
918
918
|
reject(
|
|
@@ -922,7 +922,11 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
922
922
|
);
|
|
923
923
|
return;
|
|
924
924
|
}
|
|
925
|
-
|
|
925
|
+
if (head && head.length > 0) {
|
|
926
|
+
socket.unshift(head);
|
|
927
|
+
}
|
|
928
|
+
const agent = new import_node_https.default.Agent({ keepAlive: false });
|
|
929
|
+
agent.createConnection = () => import_node_tls.default.connect({
|
|
926
930
|
socket,
|
|
927
931
|
servername: targetUrl.hostname
|
|
928
932
|
});
|
|
@@ -933,8 +937,7 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
933
937
|
path: `${targetUrl.pathname}${targetUrl.search}`,
|
|
934
938
|
method,
|
|
935
939
|
headers,
|
|
936
|
-
agent
|
|
937
|
-
createConnection: () => tlsSocket
|
|
940
|
+
agent
|
|
938
941
|
},
|
|
939
942
|
handleIncoming
|
|
940
943
|
);
|
package/dist/index.js
CHANGED
|
@@ -821,7 +821,7 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
821
821
|
);
|
|
822
822
|
});
|
|
823
823
|
connectReq.on("error", reject);
|
|
824
|
-
connectReq.on("connect", (connectRes, socket) => {
|
|
824
|
+
connectReq.on("connect", (connectRes, socket, head) => {
|
|
825
825
|
if (connectRes.statusCode !== 200) {
|
|
826
826
|
socket.destroy();
|
|
827
827
|
reject(
|
|
@@ -831,7 +831,11 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
831
831
|
);
|
|
832
832
|
return;
|
|
833
833
|
}
|
|
834
|
-
|
|
834
|
+
if (head && head.length > 0) {
|
|
835
|
+
socket.unshift(head);
|
|
836
|
+
}
|
|
837
|
+
const agent = new https.Agent({ keepAlive: false });
|
|
838
|
+
agent.createConnection = () => tls.connect({
|
|
835
839
|
socket,
|
|
836
840
|
servername: targetUrl.hostname
|
|
837
841
|
});
|
|
@@ -842,8 +846,7 @@ function singleRequest(targetUrl, method, headers) {
|
|
|
842
846
|
path: `${targetUrl.pathname}${targetUrl.search}`,
|
|
843
847
|
method,
|
|
844
848
|
headers,
|
|
845
|
-
agent
|
|
846
|
-
createConnection: () => tlsSocket
|
|
849
|
+
agent
|
|
847
850
|
},
|
|
848
851
|
handleIncoming
|
|
849
852
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "image-optimizer-node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Production-grade Node.js CLI, SDK, and GitHub Action wrapper around imgopt (Image-Optimizer-Cli) with auto-init config, idempotent dual-hash deduplication, and original image backup/restore.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|