Skip to content

Commit

Permalink
fix(#10717): com.alibaba.nacos.common.http.client.request.JdkHttpClie…
Browse files Browse the repository at this point in the history
…ntRequest.execute, when the body instanceof String, no longer call com.alibaba.nacos.common.utils.JacksonUtils.toJson to parse body. (#10718)
  • Loading branch information
Bo-Qiu authored Jul 1, 2023
1 parent b0b16e3 commit 9116aee
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public HttpClientResponse execute(URI uri, String httpMethod, RequestHttpEntity
conn.setRequestMethod(httpMethod);
if (body != null && !"".equals(body)) {
String contentType = headers.getValue(HttpHeaderConsts.CONTENT_TYPE);
String bodyStr = JacksonUtils.toJson(body);
String bodyStr = body instanceof String ? (String) body : JacksonUtils.toJson(body);
if (MediaType.APPLICATION_FORM_URLENCODED.equals(contentType)) {
Map<String, String> map = JacksonUtils.toObj(bodyStr, HashMap.class);
bodyStr = HttpUtils.encodingParams(map, headers.getCharset());
Expand Down

0 comments on commit 9116aee

Please sign in to comment.