Update http.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run

This commit is contained in:
Namhyeon Go 2024-07-21 19:55:42 +09:00 committed by GitHub
parent 0764d2793d
commit f2239e75a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,6 +103,9 @@ var HTTPObject = function(engine) {
} else if (this.engine == "BITS") { } else if (this.engine == "BITS") {
this._interface = SHELL.create(); this._interface = SHELL.create();
this._interface.setPrefix("bitsadmin.exe"); // the location of BITS binary 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; return this;
@ -453,7 +456,7 @@ var HTTPObject = function(engine) {
if (this.states.length > 0) { if (this.states.length > 0) {
// Make CURL context // Make CURL context
var state = this.states[this.states.length - 1]; var state = this.states[this.states.length - 1];
var cmd = ["bin\\curl"]; var cmd = [];
var url = state.url; var url = state.url;
if (this.isDebugging) { if (this.isDebugging) {
@ -611,6 +614,14 @@ var HTTPObject = function(engine) {
out.destroy(); // destroy the downloaded data 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") { if (typeof responseText === "string") {
@ -1077,7 +1088,7 @@ exports.parseURL = parseURL;
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT; exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
exports.defaultUserAgent = DEFAULT_USER_AGENT; // compatible with the specific case 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.AUTHOR = "abuse@catswords.net";
exports.global = global; exports.global = global;
exports.require = global.require; exports.require = global.require;