Fix mimetype detection for junked uploads
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
c0f48a7b40
commit
c574212422
|
@ -83,9 +83,13 @@ class FileMimeType extends AbstractStringCheck {
|
||||||
return $this->mimeType[$this->storage->getId()][$this->path];
|
return $this->mimeType[$this->storage->getId()][$this->path];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->request->getMethod() === 'PUT') {
|
if ($this->request->getMethod() === 'PUT' || $this->request->getMethod() === 'MOVE') {
|
||||||
$path = $this->request->getPathInfo();
|
if ($this->request->getMethod() === 'MOVE') {
|
||||||
$this->mimeType[$this->storage->getId()][$this->path] = $this->mimeTypeDetector->detectPath($path);
|
$this->mimeType[$this->storage->getId()][$this->path] = $this->mimeTypeDetector->detectPath($this->path);
|
||||||
|
} else {
|
||||||
|
$path = $this->request->getPathInfo();
|
||||||
|
$this->mimeType[$this->storage->getId()][$this->path] = $this->mimeTypeDetector->detectPath($path);
|
||||||
|
}
|
||||||
return $this->mimeType[$this->storage->getId()][$this->path];
|
return $this->mimeType[$this->storage->getId()][$this->path];
|
||||||
}
|
}
|
||||||
} else if ($this->isPublicWebDAVRequest()) {
|
} else if ($this->isPublicWebDAVRequest()) {
|
||||||
|
@ -171,7 +175,9 @@ class FileMimeType extends AbstractStringCheck {
|
||||||
$this->request->getPathInfo() === '/webdav' ||
|
$this->request->getPathInfo() === '/webdav' ||
|
||||||
strpos($this->request->getPathInfo(), '/webdav/') === 0 ||
|
strpos($this->request->getPathInfo(), '/webdav/') === 0 ||
|
||||||
$this->request->getPathInfo() === '/dav/files' ||
|
$this->request->getPathInfo() === '/dav/files' ||
|
||||||
strpos($this->request->getPathInfo(), '/dav/files/') === 0
|
strpos($this->request->getPathInfo(), '/dav/files/') === 0 ||
|
||||||
|
$this->request->getPathInfo() === '/dav/uploads' ||
|
||||||
|
strpos($this->request->getPathInfo(), '/dav/uploads/') === 0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue