2022-12-03 02:10:49

This commit is contained in:
blackmatrix7
2022-12-03 10:47:08 +08:00
parent 5a88a2b13a
commit ccdd167a9a
6877 changed files with 803900 additions and 510715 deletions

View File

@@ -32,25 +32,28 @@ function getRegexp(re_str) {
}
}
let body;
if (typeof $argument == "undefined") {
$done({});
console.log("requires $argument");
} else {
let body;
if ($script.type === "http-response") {
body = $response.body;
} else if ($script.type === "http-request") {
body = $request.body;
} else {
$done({});
console.log("script type error");
}
if (!body) {
$done({})
}
}
if (body) {
$argument.split("&").forEach((item) => {
let [match, replace] = item.split("->");
let re = getRegexp(match);
body = body.replace(re, replace);
});
$done({ body });
} else {
console.log("Not Modify");
$done({});
}