Merge pull request #4010 from nextcloud/fac-58-mimetype-on-creating-directories

Fix workflow engine mimetype detection when creating a directory
This commit is contained in:
Joas Schilling 2017-03-24 10:55:10 +01:00 committed by GitHub
commit 35d3a082f2
1 changed files with 6 additions and 0 deletions

View File

@ -77,6 +77,12 @@ class FileMimeType extends AbstractStringCheck {
}
if ($this->isWebDAVRequest()) {
// Creating a folder
if ($this->request->getMethod() === 'MKCOL') {
$this->mimeType[$this->storage->getId()][$this->path] = 'httpd/unix-directory';
return $this->mimeType[$this->storage->getId()][$this->path];
}
if ($this->request->getMethod() === 'PUT') {
$path = $this->request->getPathInfo();
$this->mimeType[$this->storage->getId()][$this->path] = $this->mimeTypeDetector->detectPath($path);