Browse Source

Fix switch js, add black key (#15680)

Co-authored-by: fuchanghai <changhaifu@apache.org>
Co-authored-by: Eric Gao <ericgao.apache@gmail.com>
dev_wenjun_refactorMaster
caishunfeng 8 months ago committed by GitHub
parent
commit
4a255fd523
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/SwitchTaskUtils.java
  2. 10
      dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/utils/SwitchTaskUtilsTest.java

4
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/SwitchTaskUtils.java

@ -50,6 +50,10 @@ public class SwitchTaskUtils {
"eval",
"function",
"import",
".",
"()",
"[",
"]",
"\\\\");
static {

10
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/utils/SwitchTaskUtilsTest.java

@ -65,5 +65,15 @@ public class SwitchTaskUtilsTest {
SwitchTaskUtils.generateContentWithTaskParams(contentWithUnicode, globalParams, varParams);
});
String contentWithSpecify1 = "cmd.abc";
Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> {
SwitchTaskUtils.generateContentWithTaskParams(contentWithSpecify1, globalParams, varParams);
});
String contentWithSpecify2 = "cmd()";
Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> {
SwitchTaskUtils.generateContentWithTaskParams(contentWithSpecify2, globalParams, varParams);
});
}
}

Loading…
Cancel
Save