aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/lib/activitypub/actor.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts
index 8c5c618fc..fd934443b 100644
--- a/server/lib/activitypub/actor.ts
+++ b/server/lib/activitypub/actor.ts
@@ -221,9 +221,15 @@ function getAvatarInfoIfExists (actorJSON: ActivityPubActor) {
221 221
222 if (!icon || icon.type !== 'Image' || !isActivityPubUrlValid(icon.url)) return undefined 222 if (!icon || icon.type !== 'Image' || !isActivityPubUrlValid(icon.url)) return undefined
223 223
224 const extension = icon.mediaType 224 let extension: string
225 ? mimetypes.MIMETYPE_EXT[icon.mediaType] 225
226 : extname(icon.url) 226 if (icon.mediaType) {
227 extension = mimetypes.MIMETYPE_EXT[icon.mediaType]
228 } else {
229 const tmp = extname(icon.url)
230
231 if (mimetypes.EXT_MIMETYPE[tmp] !== undefined) extension = tmp
232 }
227 233
228 if (!extension) return undefined 234 if (!extension) return undefined
229 235