From a5f007a088d8ecaf9924b7afc9e35c5995860d22 Mon Sep 17 00:00:00 2001 From: mediabot-pt <295750538+mediabot-pt@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:28:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20content=5Ftype=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=88=AA=E6=96=AD=E8=BF=87=E9=95=BF=E7=9A=84=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E4=BF=9D=E7=95=99html/json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/par/core/service/impl/AccessResultServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/par-core/src/main/java/com/par/core/service/impl/AccessResultServiceImpl.java b/par-core/src/main/java/com/par/core/service/impl/AccessResultServiceImpl.java index 82c59cd..929118a 100644 --- a/par-core/src/main/java/com/par/core/service/impl/AccessResultServiceImpl.java +++ b/par-core/src/main/java/com/par/core/service/impl/AccessResultServiceImpl.java @@ -46,7 +46,11 @@ public class AccessResultServiceImpl implements AccessResultService { public AccessResult submit(String siteId, String configVersion, String clientId, String contentType, String content, String url, Integer statusCode, Integer responseTimeMs, Long submitterId) { - String type = (contentType != null && !contentType.isBlank()) ? contentType : "html"; + // content_type 只保留简短值(html/json),截断过长的 + String type = (contentType != null && !contentType.isBlank()) ? + (contentType.length() > 10 ? contentType.substring(0, 10) : contentType) : "html"; + type = type.contains("json") ? "json" : type.contains("html") ? "html" : + type.length() > 4 ? "html" : type; String ext = "json".equalsIgnoreCase(type) ? "json" : "html"; // 去重:5分钟内相同site+url+contentHash跳过