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>
This commit is contained in:
Roeland Jago Douma 2018-10-29 21:35:08 +01:00
parent 450b9e2a20
commit fc49fa1620
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 5 additions and 0 deletions

View 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') {