Skip to content

Commit fcb24e2

Browse files
修复部分去重失效,和surge bodyrewrite转loon出错的问题
1 parent a3077af commit fcb24e2

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

Rewrite-Parser.beta.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ if (binaryInfo != null && binaryInfo.length > 0) {
923923
proto,
924924
size,
925925
timeout: '60',
926+
jsarg,
926927
ori: x,
927928
num: y,
928929
})
@@ -961,6 +962,7 @@ if (binaryInfo != null && binaryInfo.length > 0) {
961962
jsptn: '',
962963
cronexp,
963964
jsurl,
965+
jsarg,
964966
wakesys: '1',
965967
timeout: '120',
966968
ori: x,
@@ -974,7 +976,7 @@ if (binaryInfo != null && binaryInfo.length > 0) {
974976
getMockInfo(x, mark, y)
975977
}
976978
} //for await循环结束
977-
979+
$.log($.toStr(jsBox))
978980
//去重
979981
let obj = {}
980982

@@ -1287,7 +1289,13 @@ if (binaryInfo != null && binaryInfo.length > 0) {
12871289

12881290
for (let i = 0; i < rwbodyBox.length; i++) {
12891291
const { type, regex, value } = rwbodyBox[i]
1290-
BodyRewrite.push(`${type} ${regex} ${value}`)
1292+
if (isSurgeiOS || isShadowrocket){
1293+
BodyRewrite.push(`${type} ${regex} ${value}`)
1294+
}else if (isLooniOS){
1295+
let type2 = /request/.test(type) ? 'request-body-json-jq' : 'response-body-json-jq';
1296+
URLRewrite.push(`${regex} ${type2} ${value}`)
1297+
}
1298+
12911299
}
12921300

12931301
//headerRewrite输出

Rewrite-Parser.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ if (binaryInfo != null && binaryInfo.length > 0) {
923923
proto,
924924
size,
925925
timeout: '60',
926+
jsarg,
926927
ori: x,
927928
num: y,
928929
})
@@ -961,6 +962,7 @@ if (binaryInfo != null && binaryInfo.length > 0) {
961962
jsptn: '',
962963
cronexp,
963964
jsurl,
965+
jsarg,
964966
wakesys: '1',
965967
timeout: '120',
966968
ori: x,
@@ -974,7 +976,7 @@ if (binaryInfo != null && binaryInfo.length > 0) {
974976
getMockInfo(x, mark, y)
975977
}
976978
} //for await循环结束
977-
979+
$.log($.toStr(jsBox))
978980
//去重
979981
let obj = {}
980982

@@ -1287,7 +1289,13 @@ if (binaryInfo != null && binaryInfo.length > 0) {
12871289

12881290
for (let i = 0; i < rwbodyBox.length; i++) {
12891291
const { type, regex, value } = rwbodyBox[i]
1290-
BodyRewrite.push(`${type} ${regex} ${value}`)
1292+
if (isSurgeiOS || isShadowrocket){
1293+
BodyRewrite.push(`${type} ${regex} ${value}`)
1294+
}else if (isLooniOS){
1295+
let type2 = /request/.test(type) ? 'request-body-json-jq' : 'response-body-json-jq';
1296+
URLRewrite.push(`${regex} ${type2} ${value}`)
1297+
}
1298+
12911299
}
12921300

12931301
//headerRewrite输出

0 commit comments

Comments
 (0)