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 Jul 7, 2020
1 parent 328a815 commit 46ac004
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 46ac004

Please sign in to comment.