Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): reject unsupported composer image types at attach time #6574

Mergedmdshzb04(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/6574/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 18 additions and 0 deletions (loading 2).

x
0 of 5 viewed, 5 left
8 additions and 0 deletionsapps/mobile/src/features/sharing/incoming-share-model.tsModified
View file
@@ -1,4 +1,5 @@
import {
+ isProviderSendTurnSupportedImageMimeType,
PROVIDER_SEND_TURN_MAX_ATTACHMENTS,
PROVIDER_SEND_TURN_MAX_IMAGE_BYTES,
} from "@t3tools/contracts";
@@ -162,6 +163,13 @@
await releaseOwnedFiles(input.fileReader, [uri, payload.value]);
continue;
+ if (!isProviderSendTurnSupportedImageMimeType(mimeType)) {
+ warnings.push(
+ `'${resolved?.originalName ?? fallbackName(uri, index, mimeType)}' is not a supported image type.`,
+ );
+ await releaseOwnedFiles(input.fileReader, [uri, payload.value]);
+ continue;
+ }
if (
resolved?.contentSize !== null &&
resolved?.contentSize !== undefined &&
5 additions and 0 deletionsapps/mobile/src/lib/composerImages.tsModified
View file
@@ -1,4 +1,5 @@
import {
+ isProviderSendTurnSupportedImageMimeType,
PROVIDER_SEND_TURN_MAX_ATTACHMENTS,
PROVIDER_SEND_TURN_MAX_IMAGE_BYTES,
type UploadChatImageAttachment,