mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	update 优化 RepeatedlyRequestWrapper 流处理 去除多余编码转换
This commit is contained in:
		@@ -1,7 +1,6 @@
 | 
			
		||||
package com.ruoyi.common.filter;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.io.IoUtil;
 | 
			
		||||
import cn.hutool.core.util.StrUtil;
 | 
			
		||||
import com.ruoyi.common.constant.Constants;
 | 
			
		||||
 | 
			
		||||
import javax.servlet.ReadListener;
 | 
			
		||||
@@ -13,7 +12,6 @@ import java.io.BufferedReader;
 | 
			
		||||
import java.io.ByteArrayInputStream;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.io.InputStreamReader;
 | 
			
		||||
import java.nio.charset.StandardCharsets;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 构建可重复读取inputStream的request
 | 
			
		||||
@@ -28,7 +26,7 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper {
 | 
			
		||||
        request.setCharacterEncoding(Constants.UTF8);
 | 
			
		||||
        response.setCharacterEncoding(Constants.UTF8);
 | 
			
		||||
 | 
			
		||||
        body = StrUtil.str(IoUtil.readBytes(request.getInputStream(), false), StandardCharsets.UTF_8).getBytes();
 | 
			
		||||
        body = IoUtil.readBytes(request.getInputStream(), false);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user