]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix broken backport 22240/head
authorJoas Schilling <coding@schilljs.com>
Wed, 19 Aug 2020 13:43:10 +0000 (15:43 +0200)
committerJoas Schilling <coding@schilljs.com>
Wed, 19 Aug 2020 13:43:10 +0000 (15:43 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/dav/lib/Upload/ChunkingPlugin.php
apps/dav/tests/unit/Upload/ChunkingPluginTest.php

index 631111ad12826fac31a5059bf088a1eec52e76af..1e6375fd8e5d4158decf3e76022cf7e58bff7968 100644 (file)
@@ -23,6 +23,7 @@
 
 namespace OCA\DAV\Upload;
 
+use OCA\DAV\Connector\Sabre\Exception\Forbidden;
 use Sabre\DAV\Exception\BadRequest;
 use Sabre\DAV\Server;
 use Sabre\DAV\ServerPlugin;
index bdce22c1591a100611c8cd623d101bcd07c5c6d9..c3708bce974f34b719503cd4803d50a2da820d28 100644 (file)
@@ -101,8 +101,12 @@ class ChunkingPluginTest extends TestCase {
                        ->method('nodeExists')
                        ->with('target')
                        ->will($this->returnValue(false));
-               $this->response->expects($this->never())
-                       ->method('setStatus');
+               $this->response->expects($this->once())
+                       ->method('setHeader')
+                       ->with('Content-Length', '0');
+               $this->response->expects($this->once())
+                       ->method('setStatus')
+                       ->with(201);
                $this->request->expects($this->once())
                        ->method('getHeader')
                        ->with('OC-Total-Length')
@@ -143,7 +147,7 @@ class ChunkingPluginTest extends TestCase {
                $this->assertFalse($this->plugin->beforeMove('source', 'target'));
        }
 
-       
+
        public function testBeforeMoveSizeIsWrong() {
                $this->expectException(\Sabre\DAV\Exception\BadRequest::class);
                $this->expectExceptionMessage('Chunks on server do not sum up to 4 but to 3 bytes');