Browse Source

feat: Add text/plain MIME type mapping for 'text' extension

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
pull/54737/head
Marcel Klehr 1 month ago
parent
commit
8c93c00fd7
  1. 16
      lib/private/Repair/RepairMimeTypes.php
  2. 1
      resources/config/mimetypemapping.dist.json

16
lib/private/Repair/RepairMimeTypes.php

@ -350,6 +350,18 @@ class RepairMimeTypes implements IRepairStep {
return $this->updateMimetypes($updatedMimetypes);
}
/**
* @throws Exception
* @since 32.0.0
*/
private function introduceTextType(): IResult|int|null {
$updatedMimetypes = [
'text' => 'text/plain',
];
return $this->updateMimetypes($updatedMimetypes);
}
/**
@ -466,6 +478,10 @@ class RepairMimeTypes implements IRepairStep {
$out->info('Fixed musicxml mime type');
}
if (version_compare($mimeTypeVersion, '32.0.0.0', '<') && $this->introduceTextType()) {
$out->info('Fixed text mime type');
}
if (!$this->dryRun) {
$this->appConfig->setValueString('files', 'mimetype_version', $serverVersion);
}

1
resources/config/mimetypemapping.dist.json

@ -199,6 +199,7 @@
"tif": ["image/tiff"],
"tiff": ["image/tiff"],
"ttf": ["application/font-sfnt"],
"text": ["text/plain"],
"txt": ["text/plain"],
"url": ["application/internet-shortcut"],
"vcard": ["text/vcard"],

Loading…
Cancel
Save