mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 22:17:30 -07:00
Fix #2096
This commit is contained in:
parent
6a9d2c9815
commit
9173f50d8f
1 changed files with 2 additions and 0 deletions
|
@ -84,6 +84,7 @@ export default async (params: any, user: ILocalUser, app: IApp) => new Promise(a
|
||||||
});
|
});
|
||||||
|
|
||||||
if (avatar == null) return rej('avatar not found');
|
if (avatar == null) return rej('avatar not found');
|
||||||
|
if (!avatar.contentType.startsWith('image/')) return rej('avatar not an image');
|
||||||
|
|
||||||
updates.avatarUrl = avatar.metadata.thumbnailUrl || avatar.metadata.url || `${config.drive_url}/${avatar._id}`;
|
updates.avatarUrl = avatar.metadata.thumbnailUrl || avatar.metadata.url || `${config.drive_url}/${avatar._id}`;
|
||||||
|
|
||||||
|
@ -98,6 +99,7 @@ export default async (params: any, user: ILocalUser, app: IApp) => new Promise(a
|
||||||
});
|
});
|
||||||
|
|
||||||
if (banner == null) return rej('banner not found');
|
if (banner == null) return rej('banner not found');
|
||||||
|
if (!banner.contentType.startsWith('image/')) return rej('banner not an image');
|
||||||
|
|
||||||
updates.bannerUrl = banner.metadata.url || `${config.drive_url}/${banner._id}`;
|
updates.bannerUrl = banner.metadata.url || `${config.drive_url}/${banner._id}`;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue