REM:
1. 修正参数校验异常时,log打印信息
This commit is contained in:
HuangXin 2020-10-19 16:52:16 +08:00
parent b116fe9911
commit 1d100a25b6
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.nio.charset.Charset; import java.nio.charset.StandardCharsets;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
@ -191,7 +191,7 @@ public class Helper {
public static String inputStream2String(InputStream inputStream) { public static String inputStream2String(InputStream inputStream) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, Charset.defaultCharset()))) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
String line; String line;
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
sb.append(line); sb.append(line);

View File

@ -97,7 +97,7 @@ public class GlobalExceptionHandler {
"+++ Request: {}\n" + "+++ Request: {}\n" +
"--- Verify params failed: {}", "--- Verify params failed: {}",
reqType, reqPath, reqIp, reqToken, Helper.inputStream2String(req.getInputStream()), reqType, reqPath, reqIp, reqToken, Helper.inputStream2String(req.getInputStream()),
ex.getMessage()); ex.getDescription() != null ? ex.getDescription() : ex.getMessage());
} catch (Exception ignored) { } catch (Exception ignored) {
} }
log.debug("SecurityProtocolException Exception: ", ex); log.debug("SecurityProtocolException Exception: ", ex);