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-04 10:56:48 +09:00 committed by GitHub
parent a20e0004d2
commit 145e22de21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -604,11 +604,12 @@ var HTTPObject = function(engine) {
}
if (this.isJSONResponse()) {
if (typeof(WScript) !== "undefined") {
JSON = {};
FILE.includeFile("app/assets/js/json2.js");
try {
this.setResponseBody(JSON.parse(responseText));
} catch (e) {
console.error("JSON parse error: " + e.message);
this.setResponseBody({});
}
this.setResponseBody(JSON.parse(responseText));
} else {
this.setResponseBody(responseText);
}
@ -1047,7 +1048,7 @@ exports.parseURL = parseURL;
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
exports.defaultUserAgent = DEFAULT_USER_AGENT; // compatible with the specific case
exports.VERSIONINFO = "HTTP request module (http.js) version 0.7.18";
exports.VERSIONINFO = "HTTP request module (http.js) version 0.7.19";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = global.require;