garydgregory commented on code in PR #428:
URL: https://github.com/apache/commons-vfs/pull/428#discussion_r1331539191


##########
commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java:
##########
@@ -487,11 +488,17 @@ private HttpResponse executeRequest(final HttpUriRequest 
request) throws FileSys
             response = executeHttpUriRequest(request);
             final int status = response.getStatusLine().getStatusCode();
             if (status == HttpURLConnection.HTTP_NOT_FOUND || status == 
HttpURLConnection.HTTP_GONE) {
+                EntityUtils.consume(response.getEntity());
                 throw new FileNotFoundException(request.getURI());
             }
 
             if (request instanceof BaseDavRequest) {
-                ((BaseDavRequest) request).checkSuccess(response);
+                try {
+                    ((BaseDavRequest) request).checkSuccess(response);
+                } catch(DavException e){
+                    EntityUtils.consume(response.getEntity());

Review Comment:
   Hello @beise 
   Isn't the response consumed in 
`org.apache.jackrabbit.webdav.client.methods.BaseDavRequest.getResponseException(HttpResponse)`
 by calling 
`org.apache.jackrabbit.webdav.client.methods.BaseDavRequest.getResponseBodyAsDocument(HttpEntity)`
 before  throwing `DavException`?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to