Browse Source

Fix gzip mimetype mapping

PHP now detects it as application/gzip and not application/x-gzip anymore

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Côme Chilliet 1 year ago
parent
commit
b22b6431d2

+ 2 - 2
resources/config/mimetypealiases.dist.json

@@ -13,6 +13,7 @@
 	"application/font-sfnt": "image",
 	"application/font-woff": "image",
 	"application/gpx+xml": "location",
+	"application/gzip": "package/x-generic",
 	"application/illustrator": "image",
 	"application/javascript": "text/code",
 	"application/json": "text/code",
@@ -80,7 +81,7 @@
 	"application/x-fictionbook+xml": "text",
 	"application/x-font": "image",
 	"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",
@@ -115,4 +116,3 @@
 	"application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform": "x-office/form",
 	"application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf": "x-office/form-template"
 }
-

+ 2 - 2
resources/config/mimetypemapping.dist.json

@@ -65,8 +65,8 @@
 	"fodt": ["application/vnd.oasis.opendocument.text-flat-xml"],
 	"gif": ["image/gif"],
 	"gpx": ["application/gpx+xml"],
-	"gz": ["application/x-gzip"],
-	"gzip": ["application/x-gzip"],
+	"gz": ["application/gzip"],
+	"gzip": ["application/gzip"],
 	"h": ["text/x-h"],
 	"heic": ["image/heic"],
 	"heif": ["image/heif"],

+ 2 - 2
tests/lib/Files/Type/DetectionTest.php

@@ -71,7 +71,7 @@ class DetectionTest extends \Test\TestCase {
 	public function dataDetectContent(): array {
 		return [
 			['/', 'httpd/unix-directory'],
-			['/data.tar.gz', 'application/x-gzip'],
+			['/data.tar.gz', 'application/gzip'],
 			['/data.zip', 'application/zip'],
 			['/testimage.mp3', 'audio/mpeg'],
 			['/testimage.png', 'image/png'],
@@ -91,7 +91,7 @@ class DetectionTest extends \Test\TestCase {
 	public function dataDetect(): array {
 		return [
 			['/', 'httpd/unix-directory'],
-			['/data.tar.gz', 'application/x-gzip'],
+			['/data.tar.gz', 'application/gzip'],
 			['/data.zip', 'application/zip'],
 			['/testimagelarge.svg', 'image/svg+xml'],
 			['/testimage.png', 'image/png'],