Browse Source

Merge pull request #6681 from nocodb/fix/attachment-bug

fix: Use the first url from array is head request failed due to CORS
pull/6687/head
աӄա 1 year ago committed by GitHub
parent
commit
2f22b6a031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      packages/nc-gui/composables/useAttachment.ts

5
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<string, any>) => {

Loading…
Cancel
Save