We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab27e95 commit ad46a63Copy full SHA for ad46a63
apps/dav/lib/Connector/Sabre/File.php
@@ -556,6 +556,15 @@ public function delete() {
556
public function getContentType() {
557
$mimeType = $this->info->getMimetype();
558
559
+ if ($mimeType === 'application/octet-stream') {
560
+ $mimeType = \OC::$server->getMimeTypeDetector()->detectPath($this->info->getInternalPath());
561
+ if ($this->info->getMimetype() !== $mimeType) {
562
+ $this->info->getStorage()->getCache()->update($this->info->getId(), [
563
+ 'mimetype' => $mimeType
564
+ ]);
565
+ }
566
567
+
568
// PROPFIND needs to return the correct mime type, for consistency with the web UI
569
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PROPFIND') {
570
return $mimeType;
0 commit comments