mirror of
https://gitee.com/dromara/sa-token.git
synced 2026-02-27 16:50:24 +08:00
feat: 新增 SaFirewallCheckHookForPathBannedCharacter 禁用字符校验
This commit is contained in:
@@ -15,6 +15,10 @@
|
||||
*/
|
||||
package cn.dev33.satoken.core.util;
|
||||
|
||||
import cn.dev33.satoken.util.SaFoxUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
@@ -23,11 +27,6 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import cn.dev33.satoken.util.SaFoxUtil;
|
||||
|
||||
/**
|
||||
* SaFoxUtil 工具类测试
|
||||
*
|
||||
@@ -401,4 +400,12 @@ public class SaFoxUtilTest {
|
||||
Assertions.assertEquals(list.get(2), "c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hasNonPrintableASCII() {
|
||||
Assertions.assertFalse(SaFoxUtil.hasNonPrintableASCII("Hello World!"));
|
||||
Assertions.assertTrue(SaFoxUtil.hasNonPrintableASCII("Hello\u0007World"));
|
||||
Assertions.assertTrue(SaFoxUtil.hasNonPrintableASCII("Hello\tWorld"));
|
||||
Assertions.assertTrue(SaFoxUtil.hasNonPrintableASCII("Hello\nWorld"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user