fix(#10717): com.alibaba.nacos.common.http.client.request.JdkHttpClientRequest.execute, when the body instanceof String, no longer call com.alibaba.nacos.common.utils.JacksonUtils.toJson to parse body. (#10718)
This commit is contained in:
parent
b0b16e3919
commit
9116aee82f
@ -96,7 +96,7 @@ public class JdkHttpClientRequest implements HttpClientRequest {
|
||||
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());
|
||||
|
Loading…
Reference in New Issue
Block a user