Improved needs headers check

pull/212/head
M66B 2 years ago
parent d95cc81bcf
commit 7b621bd9ef

@ -150,8 +150,16 @@ public class EntityRule {
for (EntityRule rule : rules) for (EntityRule rule : rules)
try { try {
JSONObject jcondition = new JSONObject(rule.condition); JSONObject jcondition = new JSONObject(rule.condition);
if (jcondition.has(what)) if (jcondition.has(what)) {
if ("header".equals(what)) {
JSONObject jheader = jcondition.getJSONObject("header");
String value = jheader.getString("value");
boolean regex = jheader.getBoolean("regex");
if (!regex && value.startsWith("$$") && value.endsWith("$"))
continue;
}
return true; return true;
}
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(ex);
} }
@ -319,7 +327,6 @@ public class EntityRule {
boolean regex = jheader.getBoolean("regex"); boolean regex = jheader.getBoolean("regex");
if (!regex && if (!regex &&
value != null &&
value.startsWith("$") && value.startsWith("$") &&
value.endsWith("$")) { value.endsWith("$")) {
String keyword = value.substring(1, value.length() - 1); String keyword = value.substring(1, value.length() - 1);

Loading…
Cancel
Save