From: Olivier Lamy Date: Wed, 25 Jun 2014 06:27:46 +0000 (+1000) Subject: revert previous commit as 2.x was not affected in fact X-Git-Tag: archiva-2.1.0~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7cc7854a2671ef1476fc742fafb233f00836c46a;p=archiva.git revert previous commit as 2.x was not affected in fact --- diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java index 2257467b4..559f160d8 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java @@ -212,8 +212,7 @@ public class ArchivaDavResource { if ( !isCollection() ) { - //outputContext.setContentLength( localResource.length() ); - outputContext.setProperty( DavConstants.HEADER_CONTENT_LENGTH, Long.toString( localResource.length() ) ); + outputContext.setContentLength( localResource.length() ); outputContext.setContentType( mimeTypes.getMimeType( localResource.getName() ) ); } @@ -331,8 +330,7 @@ public class ArchivaDavResource } // TODO: a bad deployment shouldn't delete an existing file - do we need to write to a temporary location first? - //long expectedContentLength = inputContext.getContentLength(); - long expectedContentLength = Long.parseLong( inputContext.getProperty( DavConstants.HEADER_CONTENT_LENGTH ) ); + long expectedContentLength = inputContext.getContentLength(); long actualContentLength = localFile.length(); // length of -1 is given for a chunked request or unknown length, in which case we accept what was uploaded if ( expectedContentLength >= 0 && expectedContentLength != actualContentLength )