diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-29 21:35:08 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-29 21:35:08 +0100 |
commit | 90dc8fb42e209e8bccd1f9801c85c21e9894227f (patch) | |
tree | 03f881ba57f46fce7b2ddabfa653b856a0588ad2 /apps/workflowengine/lib | |
parent | 963d968f062810e846f000f02f1be3f560c286f9 (diff) | |
download | nextcloud-server-90dc8fb42e209e8bccd1f9801c85c21e9894227f.tar.gz nextcloud-server-90dc8fb42e209e8bccd1f9801c85c21e9894227f.zip |
A folder should get a folder mimetype
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>
Diffstat (limited to 'apps/workflowengine/lib')
-rw-r--r-- | apps/workflowengine/lib/Check/FileMimeType.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php index bd94ec9d5bc..5f572f5aa9d 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -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') { |