优化
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user