Sfoglia il codice sorgente

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

master
HupJ GitHub 4 anni fa
parent
commit
4f31b2c61b
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  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 Vedi File

@@ -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…
Annulla
Salva