This commit is contained in:
2026-08-14 14:50:39 +08:00
parent 261a8bf2df
commit 36a048a2bc
34 changed files with 263 additions and 120 deletions
@@ -6,9 +6,7 @@ function id(value) { return value == null ? '' : String(value) }
export function controlledPhotoDownload(downloadPath, response) {
const controlledPath = typeof downloadPath === 'string'
&& downloadPath.startsWith('/api/')
&& !downloadPath.startsWith('//')
&& !downloadPath.includes('://')
&& /^\/api\/platform\/v1\/containers\/[1-9]\d*\/pda\/photos\/[1-9]\d*\/download$/.test(downloadPath)
const contentType = String(response?.contentType || '').toLowerCase()
return controlledPath
&& response?.http === 200