瀏覽代碼

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 "";
}


Loading…
取消
儲存