From 9db06990459ca1ec53b85d5378f7f992c4ccf0a5 Mon Sep 17 00:00:00 2001 From: JZH <576811031@QQ.COM> Date: Mon, 6 Jul 2020 20:29:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=AF=B7=E6=B1=82charset=E9=9D=9E=E7=A9=BA=E5=88=A4=E6=96=AD?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8Dcharset.name()=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E5=BC=82=E5=B8=B8#1403=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sentinel/transport/heartbeat/client/SimpleHttpClient.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java b/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java index 6befd46f38..2dafa19b55 100755 --- a/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java +++ b/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java @@ -156,6 +156,9 @@ private String getStatusLine(RequestMethod type, String requestPath) { * @return encoded request parameters, or empty string ("") if no parameters are provided */ private String encodeRequestParams(Map paramsMap, Charset charset) { + if (charset == null){ + throw new IllegalArgumentException( "charset is not allowed to be null"); + } if (paramsMap == null || paramsMap.isEmpty()) { return ""; } From 04be4508052985dc8deaef33bcf478efea31f10c Mon Sep 17 00:00:00 2001 From: JZH <576811031@QQ.COM> Date: Mon, 6 Jul 2020 20:57:16 +0800 Subject: [PATCH 2/2] Formatting code --- .../sentinel/transport/heartbeat/client/SimpleHttpClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java b/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java index 2dafa19b55..5ec54e9fc1 100755 --- a/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java +++ b/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java @@ -156,8 +156,8 @@ private String getStatusLine(RequestMethod type, String requestPath) { * @return encoded request parameters, or empty string ("") if no parameters are provided */ private String encodeRequestParams(Map paramsMap, Charset charset) { - if (charset == null){ - throw new IllegalArgumentException( "charset is not allowed to be null"); + if (charset == null) { + throw new IllegalArgumentException("charset is not allowed to be null"); } if (paramsMap == null || paramsMap.isEmpty()) { return "";