From c4bba32b20f0869b45ed14be04543869dd91ee6c Mon Sep 17 00:00:00 2001
From: cl <1442464845@qq.com>
Date: 星期四, 09 四月 2026 18:38:44 +0800
Subject: [PATCH] 日志1
---
rsf-http-audit/src/main/java/com/vincent/rsf/httpaudit/support/HttpAuditSupport.java | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/rsf-http-audit/src/main/java/com/vincent/rsf/httpaudit/support/HttpAuditSupport.java b/rsf-http-audit/src/main/java/com/vincent/rsf/httpaudit/support/HttpAuditSupport.java
index 67ac455..e4cdcb1 100644
--- a/rsf-http-audit/src/main/java/com/vincent/rsf/httpaudit/support/HttpAuditSupport.java
+++ b/rsf-http-audit/src/main/java/com/vincent/rsf/httpaudit/support/HttpAuditSupport.java
@@ -55,7 +55,7 @@
public static boolean shouldExclude(HttpServletRequest request, HttpAuditProperties props) {
String path = safePath(request);
- for (String p : props.getExcludePathPrefixes()) {
+ for (String p : props.getEffectiveExcludePrefixes()) {
if (p != null && !p.isEmpty() && path.startsWith(p)) {
return true;
}
@@ -119,4 +119,29 @@
}
return s.substring(0, maxChars) + "...(truncated,len=" + s.length() + ")";
}
+
+ /** maxChars<0 涓嶆埅鏂� */
+ public static String storeWithCharLimit(String s, int maxChars) {
+ if (s == null) {
+ return null;
+ }
+ if (maxChars < 0) {
+ return s;
+ }
+ return truncateForStore(s, maxChars);
+ }
+
+ public static boolean overCharLimit(String s, int maxChars) {
+ return s != null && maxChars >= 0 && s.length() > maxChars;
+ }
+
+ public static String truncateUriForStore(String uri, int maxLen) {
+ if (uri == null) {
+ return "";
+ }
+ if (maxLen <= 0 || uri.length() <= maxLen) {
+ return uri;
+ }
+ return uri.substring(0, maxLen - 3) + "...";
+ }
}
--
Gitblit v1.9.1