From f2239e75a9b1194c1a896dc4ac2563439ae75c42 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sun, 21 Jul 2024 19:55:42 +0900 Subject: [PATCH] Update http.js --- lib/http.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/http.js b/lib/http.js index cdd838c..404e8cb 100644 --- a/lib/http.js +++ b/lib/http.js @@ -103,6 +103,9 @@ var HTTPObject = function(engine) { } else if (this.engine == "BITS") { this._interface = SHELL.create(); this._interface.setPrefix("bitsadmin.exe"); // the location of BITS binary + } else if (this.engine == "CERT") { + this._interface = SHELL.create(); + this._interface.setPrefix("certutil.exe"); // the location of Certutil binary } return this; @@ -453,7 +456,7 @@ var HTTPObject = function(engine) { if (this.states.length > 0) { // Make CURL context var state = this.states[this.states.length - 1]; - var cmd = ["bin\\curl"]; + var cmd = []; var url = state.url; if (this.isDebugging) { @@ -611,6 +614,14 @@ var HTTPObject = function(engine) { out.destroy(); // destroy the downloaded data } + } else if (this.engine == "CERT") { + var state = this.states[this.states.length - 1]; + var out = PipeIPC.connect("volatile"); + var cmd = ["-urlcache", "-split", "-f", state.url, out.path]; + this._interface.exec(cmd); + out.reload(); + responseText = out.read(); + out.destroy(); } if (typeof responseText === "string") { @@ -1077,7 +1088,7 @@ exports.parseURL = parseURL; exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT; exports.defaultUserAgent = DEFAULT_USER_AGENT; // compatible with the specific case -exports.VERSIONINFO = "HTTP client module (http.js) version 0.7.22"; +exports.VERSIONINFO = "HTTP client module (http.js) version 0.7.24"; exports.AUTHOR = "abuse@catswords.net"; exports.global = global; exports.require = global.require;