Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

558 B
Raw Blame
/** Only unsupported/denied multipart operations may downgrade to signed PUT. */
export function canFallbackToSingleUpload(error: unknown): boolean {
  if (!error || typeof error !== 'object') return false
  const failure = error as {
    name?: string
    Code?: string
    $metadata?: { httpStatusCode?: number }
  }
  return (
    [405, 501].includes(failure.$metadata?.httpStatusCode ?? 0) ||
    [
      'NotImplemented',
      'NotSupported',
      'UnsupportedOperation',
      'AccessDenied',
    ].includes(failure.name || failure.Code || '')
  )
}