reta commented on a change in pull request #620: CXF-7996: TCK: Resolves
FormParam-related failures
URL: https://github.com/apache/cxf/pull/620#discussion_r366102864
##########
File path:
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
##########
@@ -1878,4 +1891,16 @@ public static String logMessageHandlerProblem(String
name, Class<?> cls, MediaTy
return errorMessage;
}
+ // copy the input stream so that it is not inadvertently closed
+ private static InputStream copyAndGetEntityStream(Message m) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try {
+ IOUtils.copy(m.getContent(InputStream.class), baos);
+ } catch (IOException e) {
+ throw ExceptionUtils.toInternalServerErrorException(e, null);
+ }
+ final byte[] copiedBytes = baos.toByteArray();
+ m.setContent(InputStream.class, new ByteArrayInputStream(copiedBytes));
Review comment:
Yep, I also rerun TCK (https://issues.apache.org/jira/browse/CXF-7996) and
these failure are gone, thanks @andymc12 !
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services