diff --git a/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java b/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java index a84da9e80e7f..a54475afeae7 100644 --- a/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java +++ b/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java @@ -205,7 +205,7 @@ public byte[] getContentAsByteArray() { * @see #getContentAsByteArray() */ public String getContentAsString() { - return new String(this.cachedContent.toByteArray(), Charset.forName(getCharacterEncoding())); + return new String(this.cachedContent.toByteArrayUnsafe(), Charset.forName(getCharacterEncoding())); } /**