Skip to content

Commit

Permalink
Add explicit null checking for charset in SimpleHttpClient#encodeRequ…
Browse files Browse the repository at this point in the history
…estParams (alibaba#1589)
  • Loading branch information
JiangZian authored and mastertiller committed Aug 20, 2020
1 parent 9437575 commit 1d63598
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> paramsMap, Charset charset) {
if (charset == null) {
throw new IllegalArgumentException("charset is not allowed to be null");
}
if (paramsMap == null || paramsMap.isEmpty()) {
return "";
}
Expand Down

0 comments on commit 1d63598

Please sign in to comment.