|
@@ -1,6 +1,7 @@
|
|
|
package com.ruoyi.common.filter;
|
|
|
|
|
|
import cn.hutool.core.io.IoUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HtmlUtil;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
@@ -50,7 +51,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
|
|
}
|
|
|
|
|
|
// 为空,直接返回
|
|
|
- String json = IoUtil.read(super.getInputStream(), StandardCharsets.UTF_8);
|
|
|
+ String json = StrUtil.str(IoUtil.readBytes(super.getInputStream(), false), StandardCharsets.UTF_8);
|
|
|
if (StringUtils.isEmpty(json)) {
|
|
|
return super.getInputStream();
|
|
|
}
|
|
@@ -88,7 +89,6 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
|
|
|
|
|
/**
|
|
|
* 是否是Json请求
|
|
|
- *
|
|
|
*/
|
|
|
public boolean isJsonRequest() {
|
|
|
String header = super.getHeader(HttpHeaders.CONTENT_TYPE);
|