diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Files/Sharing/FilesDropPlugin.php | 4 | ||||
-rw-r--r-- | apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php | 14 |
2 files changed, 2 insertions, 16 deletions
diff --git a/apps/dav/lib/Files/Sharing/FilesDropPlugin.php b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php index 9d883be81fc..4e1f8bb0991 100644 --- a/apps/dav/lib/Files/Sharing/FilesDropPlugin.php +++ b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php @@ -53,8 +53,8 @@ class FilesDropPlugin extends ServerPlugin { } // Only allow file drop - if ($request->getMethod() !== 'PUT') { - throw new MethodNotAllowed('Only PUT is allowed on files drop'); + if ($request->getMethod() !== 'PUT' && $request->getMethod() !== 'MKCOL') { + throw new MethodNotAllowed('Only PUT or MKCOL are allowed on files drop'); } // Always upload at the root level diff --git a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php index 7264119f8c6..647de49527d 100644 --- a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php +++ b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php @@ -9,7 +9,6 @@ use OC\Files\View; use OCA\DAV\Files\Sharing\FilesDropPlugin; use OCP\Share\IAttributes; use OCP\Share\IShare; -use Sabre\DAV\Exception\MethodNotAllowed; use Sabre\DAV\Server; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; @@ -132,19 +131,6 @@ class FilesDropPluginTest extends TestCase { $this->plugin->beforeMethod($this->request, $this->response); } - public function testNoMKCOL(): void { - $this->plugin->enable(); - $this->plugin->setView($this->view); - $this->plugin->setShare($this->share); - - $this->request->method('getMethod') - ->willReturn('MKCOL'); - - $this->expectException(MethodNotAllowed::class); - - $this->plugin->beforeMethod($this->request, $this->response); - } - public function testNoSubdirPut(): void { $this->plugin->enable(); $this->plugin->setView($this->view); |