From b7f64142f6756650175234fc400f56a034ef6381 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 13 Oct 2023 10:44:37 +0530 Subject: [PATCH] fix: use the first url from array is head request failed due to CORS --- packages/nc-gui/composables/useAttachment.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/composables/useAttachment.ts b/packages/nc-gui/composables/useAttachment.ts index 31ccd19eeb..625a2fb62a 100644 --- a/packages/nc-gui/composables/useAttachment.ts +++ b/packages/nc-gui/composables/useAttachment.ts @@ -28,8 +28,9 @@ const useAttachment = () => { } catch {} } // if no source can be fetched, it could be probably blocked by CORS - // return original url or built url anyway - return item.url || `${appInfo.value.ncSiteUrl}/${item.path}` + // return signed url / original url / built url anyway + // which we can extract from the sources array since it's ordered based on priority + return sources[0] } const openAttachment = async (item: Record) => {