utf8编码

This commit is contained in:
阿沐 2023-03-23 18:42:11 +08:00
parent 02ed3c5d7a
commit 65650f21a7

View File

@ -10,6 +10,7 @@ import org.springframework.http.MediaType;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
@ -38,7 +39,7 @@ public class XssRequestWrapper extends HttpServletRequestWrapper {
content = filterXss(content); content = filterXss(content);
// 返回新的 ServletInputStream // 返回新的 ServletInputStream
final ByteArrayInputStream bis = new ByteArrayInputStream(content.getBytes()); final ByteArrayInputStream bis = new ByteArrayInputStream(StrUtil.bytes(content, StandardCharsets.UTF_8));
return new ServletInputStream() { return new ServletInputStream() {
@Override @Override
public boolean isFinished() { public boolean isFinished() {