fix: harden Web image admission
This commit is contained in:
@@ -37,8 +37,9 @@ export abstract class AttachmentStore extends Service {
|
||||
* Validate one image without persisting it.
|
||||
* Batch callers validate every member before saving any member.
|
||||
* @param input - encoded bytes, declared media type, and optional display name.
|
||||
* @returns completion after the encoded raster has been fully decoded.
|
||||
*/
|
||||
abstract validateImage(input: SaveImageAttachment): void
|
||||
abstract validateImage(input: SaveImageAttachment): Promise<void>
|
||||
|
||||
/**
|
||||
* Validate and durably commit one image before its owning session event is appended.
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface ImageAttachmentRef {
|
||||
name?: string
|
||||
}
|
||||
|
||||
/** Deployment-resolved limits shared by upload consumers and UI preflight. */
|
||||
/** Deployment-resolved limits used by upload admission and request buffering. */
|
||||
export interface ImageAttachmentLimits {
|
||||
maxImageBytes: number
|
||||
maxImagesPerMessage: number
|
||||
@@ -45,7 +45,7 @@ export interface ImageAttachmentLimits {
|
||||
/** Request to validate and durably commit one image. */
|
||||
export interface SaveImageAttachment {
|
||||
data: Uint8Array
|
||||
/** Caller-declared media type, checked against magic bytes. */
|
||||
/** Caller-declared media type, checked against fully decoded bytes. */
|
||||
mediaType: ImageMediaType
|
||||
/** Optional browser/provider display name; it is never interpreted as a path. */
|
||||
name?: string
|
||||
|
||||
Reference in New Issue
Block a user