From 5761ba4271200a3baf2333d265175586d87c554d Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期二, 13 九月 2022 11:02:44 +0800 Subject: [PATCH] update druid 1.2.11 => 1.2.12 update hutool 5.8.5 => 5.8.6 update dynamic-ds 3.5.1 => 3.5.2 update aws-java-sdk-s3 1.12.264 => 1.12.300 update aliyun-sms 2.0.16 => 2.0.18 update tencent-sms 3.1.555 => 3.1.591 --- ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java | 35 +++++++++++++---------------------- 1 files changed, 13 insertions(+), 22 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java index 74659bf..ca76e76 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java @@ -1,6 +1,7 @@ package com.ruoyi.common.filter; import cn.hutool.core.io.IoUtil; +import com.ruoyi.common.constant.Constants; import javax.servlet.ReadListener; import javax.servlet.ServletInputStream; @@ -18,58 +19,48 @@ * * @author ruoyi */ -public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper -{ +public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper { private final byte[] body; - public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException - { + public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException { super(request); - request.setCharacterEncoding("UTF-8"); - response.setCharacterEncoding("UTF-8"); + request.setCharacterEncoding(Constants.UTF8); + response.setCharacterEncoding(Constants.UTF8); body = IoUtil.readUtf8(request.getInputStream()).getBytes(StandardCharsets.UTF_8); } @Override - public BufferedReader getReader() throws IOException - { + public BufferedReader getReader() throws IOException { return new BufferedReader(new InputStreamReader(getInputStream())); } @Override - public ServletInputStream getInputStream() throws IOException - { + public ServletInputStream getInputStream() throws IOException { final ByteArrayInputStream bais = new ByteArrayInputStream(body); - return new ServletInputStream() - { + return new ServletInputStream() { @Override - public int read() throws IOException - { + public int read() throws IOException { return bais.read(); } @Override - public int available() throws IOException - { + public int available() throws IOException { return body.length; } @Override - public boolean isFinished() - { + public boolean isFinished() { return false; } @Override - public boolean isReady() - { + public boolean isReady() { return false; } @Override - public void setReadListener(ReadListener readListener) - { + public void setReadListener(ReadListener readListener) { } }; -- Gitblit v1.9.3