Pārlūkot izejas kodu

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

master
HupJ GitHub pirms 4 gadiem
vecāks
revīzija
4f31b2c61b
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  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 Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt