This commit is contained in:
syuilo
2019-02-07 21:02:33 +09:00
parent 27768081e2
commit 5448c22031
19 changed files with 125 additions and 194 deletions

View File

@ -50,9 +50,8 @@ async function save(path: string, name: string, type: string, hash: string, size
if (type === 'image/webp') ext = '.webp';
}
const baseUrl = config.drive.baseUrl.getOrElse(
`${ config.drive.config.useSSL ? 'https' : 'http' }://${ config.drive.config.endPoint }${ config.drive.config.port ? `:${config.drive.config.port}` : '' }/${ config.drive.bucket }`
);
const baseUrl = config.drive.baseUrl
|| `${ config.drive.config.useSSL ? 'https' : 'http' }://${ config.drive.config.endPoint }${ config.drive.config.port ? `:${config.drive.config.port}` : '' }/${ config.drive.bucket }`;
// for original
const key = `${config.drive.prefix}/${uuid.v4()}${ext}`;