From 59a5b338e4bcd09463a32f6127d886eac2ad1003 Mon Sep 17 00:00:00 2001 From: Sylvia Crowe Date: Fri, 31 Jan 2025 11:24:05 -0800 Subject: [PATCH] fix: use correct mimetypes for .pem and .pub This changes the .pem mimetype to application/x-pem-file. It also changes the .pub mimetype to text/plain. Lastly, it updates textApplicationMimetypes with this change. --- frontend/app/view/preview/preview.tsx | 2 +- pkg/util/fileutil/mimetypes.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/view/preview/preview.tsx b/frontend/app/view/preview/preview.tsx index 579612f4a9..6d046b5ed7 100644 --- a/frontend/app/view/preview/preview.tsx +++ b/frontend/app/view/preview/preview.tsx @@ -74,8 +74,8 @@ const SpecializedViewMap: { [view: string]: ({ model }: SpecializedViewProps) => const textApplicationMimetypes = [ "application/sql", - "application/pem-certificate-chain", "application/x-php", + "application/x-pem-file", "application/x-httpd-php", "application/liquid", "application/graphql", diff --git a/pkg/util/fileutil/mimetypes.go b/pkg/util/fileutil/mimetypes.go index cf1b9d069c..f6baafad89 100644 --- a/pkg/util/fileutil/mimetypes.go +++ b/pkg/util/fileutil/mimetypes.go @@ -128,7 +128,6 @@ var StaticMimeTypeMap = map[string]string{ ".relo": "application/p2p-overlay+xml", ".pdf": "application/pdf", ".pdx": "application/PDX", - ".pem": "application/pem-certificate-chain", ".pgp": "application/pgp-encrypted", ".asc": "application/pgp-keys", ".sig": "application/pgp-signature", @@ -351,7 +350,6 @@ var StaticMimeTypeMap = map[string]string{ ".ecig": "application/vnd.evolv.ecig.settings", ".ecigtheme": "application/vnd.evolv.ecig.theme", ".mpw": "application/vnd.exstream-empower+zip", - ".pub": "application/vnd.exstream-package", ".ez2": "application/vnd.ezpix-album", ".ez3": "application/vnd.ezpix-package", ".gdz": "application/vnd.familysearch.gedcom+zip", @@ -769,6 +767,7 @@ var StaticMimeTypeMap = map[string]string{ ".gtar": "application/x-gtar", ".tgz": "application/x-gtar-compressed", ".hdf": "application/x-hdf", + ".pem": "application/x-pem-file", ".php": "application/x-php", ".hwp": "application/x-hwp", ".ica": "application/x-ica", @@ -1116,6 +1115,7 @@ var StaticMimeTypeMap = map[string]string{ ".n3": "text/n3", ".txt": "text/plain", ".conf": "text/plain", + ".pub": "text/plain", ".awk": "text/x-awk", ".provn": "text/provenance-notation", ".rst": "text/prs.fallenstein.rst",