feature: Content-Type charset 기반 인바운드/아웃바운드 인코딩 처리
This commit is contained in:
@@ -242,7 +242,17 @@ public class DJErpApiAdapterService extends HttpAdapterServiceSupport {
|
||||
byte[] data = new byte[bb.position()];
|
||||
bb.position(0);
|
||||
bb.get(data);
|
||||
paramValue = new String(data, encode);
|
||||
String bodyEncode = encode;
|
||||
String contentTypeHeader = request.getContentType();
|
||||
if (StringUtils.isNotBlank(contentTypeHeader)) {
|
||||
try {
|
||||
MediaType mediaType = MediaType.parseMediaType(contentTypeHeader);
|
||||
if (mediaType.getCharset() != null) {
|
||||
bodyEncode = mediaType.getCharset().name();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
paramValue = new String(data, bodyEncode);
|
||||
|
||||
if (traceLevel >= 3) {
|
||||
HttpMemoryLogger.txlog(adptGrpName + adptName,
|
||||
|
||||
Reference in New Issue
Block a user