Compare commits

...

2 Commits

Author SHA1 Message Date
9703d613cf 10.21.2 2018-10-16 20:59:49 +09:00
704e217dbb オブジェクトストレージのURLに拡張子を含めるように 2018-10-16 20:59:36 +09:00
2 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "misskey", "name": "misskey",
"author": "syuilo <i@syuilo.com>", "author": "syuilo <i@syuilo.com>",
"version": "10.21.1", "version": "10.21.2",
"clientVersion": "1.0.10618", "clientVersion": "1.0.10618",
"codename": "nighthike", "codename": "nighthike",
"main": "./built/index.js", "main": "./built/index.js",

View File

@ -37,8 +37,10 @@ async function save(path: string, name: string, type: string, hash: string, size
if (config.drive && config.drive.storage == 'minio') { if (config.drive && config.drive.storage == 'minio') {
const minio = new Minio.Client(config.drive.config); const minio = new Minio.Client(config.drive.config);
const key = `${config.drive.prefix}/${uuid.v4()}`; const [ext] = (name.match(/\.([a-zA-Z0-9_-]+)$/) || ['']);
const thumbnailKey = `${config.drive.prefix}/${uuid.v4()}`;
const key = `${config.drive.prefix}/${uuid.v4()}${ext}`;
const thumbnailKey = `${config.drive.prefix}/${uuid.v4()}.jpg`;
const baseUrl = config.drive.baseUrl 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 }`; || `${ config.drive.config.useSSL ? 'https' : 'http' }://${ config.drive.config.endPoint }${ config.drive.config.port ? `:${config.drive.config.port}` : '' }/${ config.drive.bucket }`;