diff --git a/org.springframework.integration.http/src/main/java/org/springframework/integration/http/DefaultInboundRequestMapper.java b/org.springframework.integration.http/src/main/java/org/springframework/integration/http/DefaultInboundRequestMapper.java index b6fc6ac002..ca4f6091c6 100644 --- a/org.springframework.integration.http/src/main/java/org/springframework/integration/http/DefaultInboundRequestMapper.java +++ b/org.springframework.integration.http/src/main/java/org/springframework/integration/http/DefaultInboundRequestMapper.java @@ -236,9 +236,8 @@ public class DefaultInboundRequestMapper implements InboundRequestMapper { } private Object createPayloadFromTextContent(HttpServletRequest request) throws IOException { - String charSet = request.getCharacterEncoding() == null ? "utf-8" : request.getCharacterEncoding(); - String str = new String(FileCopyUtils.copyToByteArray(request.getInputStream()), charSet); - return str; + String charset = request.getCharacterEncoding() != null ? request.getCharacterEncoding() : "utf-8"; + return new String(FileCopyUtils.copyToByteArray(request.getInputStream()), charset); } private Object createPayloadFromSerializedObject(HttpServletRequest request) {