From 24e46621713a1aaf08179df5b0c2f7b246f95567 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 28 Feb 2024 11:35:00 -0600 Subject: [PATCH] add server checks for string lengths on userfiles titles, the db already had this constraint, this prevents 500 errors, I think this also resolves all of the viable concerns in #1770 --- TASVideos/Pages/UserFiles/Models/UserFileEditModel.cs | 1 + TASVideos/Pages/UserFiles/Models/UserFileUploadModel.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/TASVideos/Pages/UserFiles/Models/UserFileEditModel.cs b/TASVideos/Pages/UserFiles/Models/UserFileEditModel.cs index d77021eb1..b0fce4a60 100644 --- a/TASVideos/Pages/UserFiles/Models/UserFileEditModel.cs +++ b/TASVideos/Pages/UserFiles/Models/UserFileEditModel.cs @@ -6,6 +6,7 @@ namespace TASVideos.Pages.UserFiles.Models; public class UserFileEditModel { [Required] + [StringLength(255)] public string Title { get; set; } = ""; [Required] diff --git a/TASVideos/Pages/UserFiles/Models/UserFileUploadModel.cs b/TASVideos/Pages/UserFiles/Models/UserFileUploadModel.cs index f3e39d6f2..f66f3b6c9 100644 --- a/TASVideos/Pages/UserFiles/Models/UserFileUploadModel.cs +++ b/TASVideos/Pages/UserFiles/Models/UserFileUploadModel.cs @@ -9,6 +9,7 @@ public class UserFileUploadModel public IFormFile? File { get; set; } [Required] + [StringLength(255)] public string Title { get; set; } = ""; [Required]