From ea54cd04c1ff0e55651cd5fb1a83672acde68604 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Jun 2021 09:33:03 +0200 Subject: Fix video upload with a capitalized ext --- server/lib/activitypub/actors/shared/object-to-model-attributes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/lib/activitypub') diff --git a/server/lib/activitypub/actors/shared/object-to-model-attributes.ts b/server/lib/activitypub/actors/shared/object-to-model-attributes.ts index 66b22c952..f53b98448 100644 --- a/server/lib/activitypub/actors/shared/object-to-model-attributes.ts +++ b/server/lib/activitypub/actors/shared/object-to-model-attributes.ts @@ -1,5 +1,5 @@ -import { extname } from 'path' import { v4 as uuidv4 } from 'uuid' +import { getLowercaseExtension } from '@server/helpers/core-utils' import { isActivityPubUrlValid } from '@server/helpers/custom-validators/activitypub/misc' import { MIMETYPES } from '@server/initializers/constants' import { ActorModel } from '@server/models/actor/actor' @@ -43,7 +43,7 @@ function getImageInfoFromObject (actorObject: ActivityPubActor, type: ActorImage if (icon.mediaType) { extension = mimetypes.MIMETYPE_EXT[icon.mediaType] } else { - const tmp = extname(icon.url) + const tmp = getLowercaseExtension(icon.url) if (mimetypes.EXT_MIMETYPE[tmp] !== undefined) extension = tmp } -- cgit v1.2.3