浏览代码

Add explicit null checking for charset in SimpleHttpClient#encodeRequestParams (#1589)

master
HupJ GitHub 4 年前
父节点
当前提交
4f31b2c61b
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. +3
    -0
      sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java

+ 3
- 0
sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java 查看文件

@@ -156,6 +156,9 @@ public class SimpleHttpClient {
* @return encoded request parameters, or empty string ("") if no parameters are provided
*/
private String encodeRequestParams(Map<String, String> paramsMap, Charset charset) {
if (charset == null) {
throw new IllegalArgumentException("charset is not allowed to be null");
}
if (paramsMap == null || paramsMap.isEmpty()) {
return "";
}


正在加载...
取消
保存