diff options
Diffstat (limited to 'server/lib/local-actor.ts')
-rw-r--r-- | server/lib/local-actor.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/local-actor.ts b/server/lib/local-actor.ts index 55e77dd04..2d2bd43a1 100644 --- a/server/lib/local-actor.ts +++ b/server/lib/local-actor.ts | |||
@@ -1,8 +1,9 @@ | |||
1 | import 'multer' | 1 | import 'multer' |
2 | import { queue } from 'async' | 2 | import { queue } from 'async' |
3 | import * as LRUCache from 'lru-cache' | 3 | import * as LRUCache from 'lru-cache' |
4 | import { extname, join } from 'path' | 4 | import { join } from 'path' |
5 | import { v4 as uuidv4 } from 'uuid' | 5 | import { v4 as uuidv4 } from 'uuid' |
6 | import { getLowercaseExtension } from '@server/helpers/core-utils' | ||
6 | import { ActorModel } from '@server/models/actor/actor' | 7 | import { ActorModel } from '@server/models/actor/actor' |
7 | import { ActivityPubActorType, ActorImageType } from '@shared/models' | 8 | import { ActivityPubActorType, ActorImageType } from '@shared/models' |
8 | import { retryTransactionWrapper } from '../helpers/database-utils' | 9 | import { retryTransactionWrapper } from '../helpers/database-utils' |
@@ -41,7 +42,7 @@ async function updateLocalActorImageFile ( | |||
41 | ? ACTOR_IMAGES_SIZE.AVATARS | 42 | ? ACTOR_IMAGES_SIZE.AVATARS |
42 | : ACTOR_IMAGES_SIZE.BANNERS | 43 | : ACTOR_IMAGES_SIZE.BANNERS |
43 | 44 | ||
44 | const extension = extname(imagePhysicalFile.filename) | 45 | const extension = getLowercaseExtension(imagePhysicalFile.filename) |
45 | 46 | ||
46 | const imageName = uuidv4() + extension | 47 | const imageName = uuidv4() + extension |
47 | const destination = join(CONFIG.STORAGE.ACTOR_IMAGES, imageName) | 48 | const destination = join(CONFIG.STORAGE.ACTOR_IMAGES, imageName) |