mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-09 20:57:23 +08:00
fix(log/httptrace-pro): 取消记录非 JSON 格式请求体
This commit is contained in:
@@ -80,9 +80,10 @@ public final class RecordableServletHttpRequest implements RecordableHttpRequest
|
|||||||
public String getBody() {
|
public String getBody() {
|
||||||
ContentCachingRequestWrapper wrapper = WebUtils.getNativeRequest(request, ContentCachingRequestWrapper.class);
|
ContentCachingRequestWrapper wrapper = WebUtils.getNativeRequest(request, ContentCachingRequestWrapper.class);
|
||||||
if (null != wrapper) {
|
if (null != wrapper) {
|
||||||
return StrUtil.utf8Str(wrapper.getContentAsByteArray());
|
String body = StrUtil.utf8Str(wrapper.getContentAsByteArray());
|
||||||
|
return JSONUtil.isTypeJSON(body) ? body : null;
|
||||||
}
|
}
|
||||||
return StringConstants.EMPTY;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user