Harden media uploads and message attachments

Enforce upload limits and safer media metadata, validate attachment ownership and encrypted-message references, and make message attachment binding idempotent. Add gallery media round-trip coverage and a regression test for closing older sessions.
This commit is contained in:
Artemy
2026-10-24 17:29:22 +07:00
parent a049a80e04
commit 55cc9538f7
6 changed files with 177 additions and 17 deletions
@@ -11,7 +11,7 @@ public class MediaUploadRequest
public IFormFile FromFile { get; set; }
[Required]
public MediaType Type { get; set; }
[Required, MaxLength(255)]
[Required, MaxLength(128)]
public string MimeType { get; set; } = string.Empty;
public string? EncryptedKey { get; set; } = string.Empty;
[Required]