From eb67b9615b73ae2c8451df2f6a33234a0c122f1c Mon Sep 17 00:00:00 2001 From: William Putra Intan <61998484+williamputraintan@users.noreply.github.com> Date: Mon, 6 Mar 2023 14:21:34 +1100 Subject: [PATCH] HTML Presigned URL Component Proposal (#239) --- src/components/ViewPresignedUrl/index.tsx | 33 ++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/components/ViewPresignedUrl/index.tsx b/src/components/ViewPresignedUrl/index.tsx index daec483..b660054 100644 --- a/src/components/ViewPresignedUrl/index.tsx +++ b/src/components/ViewPresignedUrl/index.tsx @@ -67,7 +67,18 @@ export default function ViewPresignedUrl({ presingedUrl }: Props) { } // Return HTML (via iframe) display - if (HTML_FILETYPE_LIST.includes(filetype)) { + + /** **************************** TEMPORARY SOLUTION **************************** + * + * Only allow S3 presigned url that is allowed to be viewed in this tag. + * + * See below 'TEMPORARY SOLUTION' block for details. Change to original solution if the fix has been made. + * + * Current solution: if (HTML_FILETYPE_LIST.includes(filetype) && presingedUrl.startsWith('https://umccr')) { + * Original solution: if (HTML_FILETYPE_LIST.includes(filetype)) { + * + * */ + if (HTML_FILETYPE_LIST.includes(filetype) && presingedUrl.startsWith('https://umccr')) { return (