Browse Source

fix: use the first url from array is head request failed due to CORS

pull/6681/head
Pranav C 1 year ago
parent
commit
b7f64142f6
  1. 5
      packages/nc-gui/composables/useAttachment.ts

5
packages/nc-gui/composables/useAttachment.ts

@ -28,8 +28,9 @@ const useAttachment = () => {
} catch {} } catch {}
} }
// if no source can be fetched, it could be probably blocked by CORS // if no source can be fetched, it could be probably blocked by CORS
// return original url or built url anyway // return signed url / original url / built url anyway
return item.url || `${appInfo.value.ncSiteUrl}/${item.path}` // which we can extract from the sources array since it's ordered based on priority
return sources[0]
} }
const openAttachment = async (item: Record<string, any>) => { const openAttachment = async (item: Record<string, any>) => {

Loading…
Cancel
Save