]> source.dussan.org Git - nextcloud-server.git/commitdiff
A folder should get a folder mimetype 12297/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Mon, 29 Oct 2018 20:35:08 +0000 (21:35 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Tue, 6 Nov 2018 07:02:21 +0000 (08:02 +0100)
If doing achunked upload the mimetype of the folder would otherwise be
guessed from the path. Which always returned application/octet-stream.

If an access control rule to block that is in place this means that all
chunked uploads fail hard in directories as the isCreatable on the
directory always fails.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/workflowengine/lib/Check/FileMimeType.php

index bd94ec9d5bc344b3ae4d04b2c406eefd037741cc..5f572f5aa9d840fb5234d6983f5cac58a1c6ffff 100644 (file)
@@ -76,6 +76,11 @@ class FileMimeType extends AbstractStringCheck {
                        return $this->mimeType[$this->storage->getId()][$this->path];
                }
 
+               if ($this->storage->is_dir($this->path)) {
+                       $this->mimeType[$this->storage->getId()][$this->path] = 'httpd/unix-directory';
+                       return $this->mimeType[$this->storage->getId()][$this->path];
+               }
+
                if ($this->isWebDAVRequest()) {
                        // Creating a folder
                        if ($this->request->getMethod() === 'MKCOL') {