From 8b0d49327a4c8ab95f93dbdbc67f57ea351c7757 Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Thu, 23 Nov 2023 16:51:58 +0530 Subject: [PATCH] feat(mimetypes): Add mimetype for ReStructuredText Signed-off-by: Anupam Kumar --- core/js/mimetypelist.js | 4 +++- lib/private/Repair/RepairMimeTypes.php | 12 ++++++++++++ resources/config/mimetypealiases.dist.json | 1 + resources/config/mimetypemapping.dist.json | 1 + .../mimetypeListModified/core/js/mimetypelist.js | 1 + .../mimetypeListModified/core/signature.json | 4 ++-- version.php | 2 +- 7 files changed, 21 insertions(+), 4 deletions(-) diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js index 2e87ce756ba50..7caeaa72f90b4 100644 --- a/core/js/mimetypelist.js +++ b/core/js/mimetypelist.js @@ -13,6 +13,7 @@ OC.MimeTypeList={ "application/font-sfnt": "font", "application/font-woff": "font", "application/gpx+xml": "location", + "application/gzip": "package/x-generic", "application/illustrator": "image", "application/javascript": "text/code", "application/json": "text/code", @@ -80,7 +81,7 @@ OC.MimeTypeList={ "application/x-fictionbook+xml": "text", "application/x-font": "font", "application/x-gimp": "image", - "application/x-gzip": "package/x-generic", + "application/x-gzip": "application/gzip", "application/x-iwork-keynote-sffkey": "x-office/presentation", "application/x-iwork-numbers-sffnumbers": "x-office/spreadsheet", "application/x-iwork-pages-sffpages": "x-office/document", @@ -105,6 +106,7 @@ OC.MimeTypeList={ "text/x-java-source": "text/code", "text/x-ldif": "text/code", "text/x-python": "text/code", + "text/x-rst": "text", "text/x-shellscript": "text/code", "web": "text/code", "application/internet-shortcut": "link", diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index b204c27a9a223..b8254c890a794 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -254,6 +254,14 @@ private function introduceAacAudioType() { return $this->updateMimetypes($updatedMimetypes); } + private function introduceReStructuredTextFormatType() { + $updatedMimetypes = [ + 'rst' => 'text/x-rst', + ]; + + return $this->updateMimetypes($updatedMimetypes); + } + /** * Fix mime types */ @@ -322,5 +330,9 @@ public function run(IOutput $out) { if (version_compare($ocVersionFromBeforeUpdate, '29.0.0.6', '<') && $this->introduceAacAudioType()) { $out->info('Fixed aac mime type'); } + + if (version_compare($ocVersionFromBeforeUpdate, '29.0.0.10', '<') && $this->introduceReStructuredTextFormatType()) { + $out->info('Fixed ReStructured Text mime type'); + } } } diff --git a/resources/config/mimetypealiases.dist.json b/resources/config/mimetypealiases.dist.json index 6b0bcf3e59aba..40144878465dc 100644 --- a/resources/config/mimetypealiases.dist.json +++ b/resources/config/mimetypealiases.dist.json @@ -106,6 +106,7 @@ "text/x-java-source": "text/code", "text/x-ldif": "text/code", "text/x-python": "text/code", + "text/x-rst": "text", "text/x-shellscript": "text/code", "web": "text/code", "application/internet-shortcut": "link", diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json index 05bcbec7fbbb6..3ff4c3c78ad64 100644 --- a/resources/config/mimetypemapping.dist.json +++ b/resources/config/mimetypemapping.dist.json @@ -174,6 +174,7 @@ "rar": ["application/x-rar-compressed"], "reveal": ["text/reveal"], "rss": ["application/rss+xml"], + "rst": ["text/x-rst"], "rtf": ["text/rtf"], "rw2": ["image/x-dcraw"], "schema": ["text/plain"], diff --git a/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js b/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js index ffcf5e1fb1c7b..8221d01a68254 100644 --- a/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js +++ b/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js @@ -106,6 +106,7 @@ OC.MimeTypeList={ "text/x-java-source": "text/code", "text/x-ldif": "text/code", "text/x-python": "text/code", + "text/x-rst": "text", "text/x-shellscript": "text/code", "web": "text/code", "application/internet-shortcut": "link", diff --git a/tests/data/integritycheck/mimetypeListModified/core/signature.json b/tests/data/integritycheck/mimetypeListModified/core/signature.json index 4ee844b87f8de..0f6ca137cdc27 100644 --- a/tests/data/integritycheck/mimetypeListModified/core/signature.json +++ b/tests/data/integritycheck/mimetypeListModified/core/signature.json @@ -1,7 +1,7 @@ { "hashes": { - "core\/js\/mimetypelist.js": "e9e515c5eeb08b02971e5943640bef89b6d1c2d746d5883bf974c6ac753f810685c7a20bf0ed4d32d8c046cd2cef6c045682c7d89c6a3b7b6c33122f5fd2088f" + "core\/js\/mimetypelist.js": "c5cc5239ea67d5f09ef49b72929205be7684c7fc7c829637cb57963bfa5a3e9ec96aec97f2935cbe7c14e96c3294f3caa25829277e691e6b494dff4be50bdb21" }, - "signature": "iKEOaoY+lowIZrDjozpCqDFtag8qtANZ4AqnwZG1HrzuP3Yv7uaCUZbpsyr4FklKyyZFbh4w5K3x5bacKq\/h7tFVu5A56sunSZIMDjO\/ToGFYtZC59hTi0mKlmR+rIbAwmlm2Qad0uSD+\/4bkihL\/haPAtV8IbHXqxwjcYjkPmyi0W3rN1sOycgbH8Hmu7UlkdZORGTVVHdMpQuIljaBGBonQUTnqUb2BVsZ7YKW3Ls1AKMBam\/OGrB8rAJOht5b86qIE1jzzU\/BI7Qs+r8C+sh84LpLgz\/33njaBNANwfnvbrcb4f\/95BZCL4DcMGfwJ\/VNRVJrBjQSweYb+ypq5WMMOUvHHEg4CovoH\/XbdCAbRVet34vRZnZe5F4bXQOZXp0eqbqoY+STwQ5Ku2O7YUWwfppjxWMMfs1hDUrvvMBFRCd5mla\/aktV7ugishcZdKUFyDsyOEtT292Cb5f\/62RqnMniD9a+TOBE1qWH5DXYQqRO9TUdVtGQ3ITbLxEAzlfUmwYoXp+wgKbzOXC4KFzpxJnxHM+vuURkO5lUza68gqiG8\/uhNcPQufDT5CjasQVBTK5tdoL64UnXqATgU3rrD\/MByOXWlZvMsAS+NjPkF30UnvqgApEwytOlTZ27+ntZjfwhM3DlXNKE3mzUx+tvVfwBDmhEpBK\/Qpk6HLc=", + "signature": "RCyHmaoLXr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FaJsZZkwlFlhRO\/\/+TJtXRbyNgsf\r\noMRZGi8DLGU2SGEAHcRH\/QZHq\/XDUWVzdxrSBYcy7GSpT7UDVzGv1rEJUrn5veP1\r\n0KmauAqtiIaYRm4f6YBsn0INcZxzIPZ0p8qFtVZBPeHhvQtvOt0iXI\/XUxEWOa2F\r\nK2EqhErgMK\/N07U1JJJay5tYZRtvkGq46oP\/5kQG8hYST0MDK6VihJoPpvCmAm4E\r\npEYKQ96x6A4EH9Y9mZlYozH\/eqmxPbTK8n89\/p7Ydun4rI+B2iiLnY8REWWy6+UQ\r\nV204fGUkJqW5CrKy3P3XvY9X\r\n-----END CERTIFICATE-----" } \ No newline at end of file diff --git a/version.php b/version.php index 579402c3e7b80..960cf3ecf21a7 100644 --- a/version.php +++ b/version.php @@ -30,7 +30,7 @@ // between betas, final and RCs. This is _not_ the public version number. Reset minor/patch level // when updating major/minor version number. -$OC_Version = [29, 0, 0, 9]; +$OC_Version = [29, 0, 0, 10]; // The human-readable string $OC_VersionString = '29.0.0 beta 3';