fix: content_type字段截断过长的值,只保留html/json
This commit is contained in:
@@ -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跳过
|
||||
|
||||
Reference in New Issue
Block a user