update ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java.

增加available方法于XssHttpServletRequestWrapper
This commit is contained in:
Ming 2021-08-24 08:42:56 +00:00 committed by Gitee
parent e52092c6d4
commit 098c650655

View File

@ -63,7 +63,8 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
// xss过滤 // xss过滤
json = EscapeUtil.clean(json).trim(); json = EscapeUtil.clean(json).trim();
final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes("utf-8")); byte[] jsonBytes = json.getBytes("utf-8");
final ByteArrayInputStream bis = new ByteArrayInputStream(jsonBytes);
return new ServletInputStream() return new ServletInputStream()
{ {
@Override @Override
@ -78,6 +79,11 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
return true; return true;
} }
@Override
public int available() throws IOException {
return jsonBytes.length;
}
@Override @Override
public void setReadListener(ReadListener readListener) public void setReadListener(ReadListener readListener)
{ {