From 280b159bd341ed4a5d4e640602fa1050e2c39e60 Mon Sep 17 00:00:00 2001 From: Mikhail Petrov Date: Wed, 5 Feb 2025 11:32:14 +0300 Subject: [PATCH 1/2] web: Use Content-Type file if it exists, closes #128 Signed-off-by: Mikhail Petrov --- src/Home.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Home.tsx b/src/Home.tsx index b8732e9..a942cd1 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -119,7 +119,7 @@ const Home = ({ 'Email': user.XAttributeEmail, }), 'X-Neofs-Expiration-Duration': lifetimeData, - 'Content-Type': file.type === '' ? 'application/octet-stream' : '', + 'Content-Type': file.type === '' ? 'application/octet-stream' : file.type, }).then((res: any) => { res['filename'] = file.name; setUploadedObjects((uploadedObjectsTemp: UploadedObject[]) => [...uploadedObjectsTemp, res]); From cbfe6ce387e6d53f62cf92b91d04baaca050c4ee Mon Sep 17 00:00:00 2001 From: Mikhail Petrov Date: Wed, 5 Feb 2025 13:45:43 +0300 Subject: [PATCH 2/2] web: Add obsolete javascript content-type for blocking Signed-off-by: Mikhail Petrov --- src/Home.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Home.tsx b/src/Home.tsx index a942cd1..86b72ed 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -34,7 +34,7 @@ const Home = ({ const handleAllFiles = (files: any) => { const unsupportedFiles: any[] = []; for (let i = 0; i < files.length; i += 1) { - if (['application/javascript', 'text/javascript', 'application/xhtml+xml', 'text/html', 'text/htmlh'].indexOf(files[i].type) === -1) { + if (['application/javascript', 'text/javascript', 'application/xhtml+xml', 'text/html', 'text/htmlh', 'application/x-javascript'].indexOf(files[i].type) === -1) { handleFile(files[i], i === (files.length - 1)); } else { unsupportedFiles.push(files[i].name);