diff --git a/src/ClientServer/Config/Constants.cs b/src/ClientServer/Config/Constants.cs index 811e59d7e849d8edb56648922fe3ffbccfbbf8ad..da100848cb02360eee3cc267894fc4139c5ccf38 100644 --- a/src/ClientServer/Config/Constants.cs +++ b/src/ClientServer/Config/Constants.cs @@ -13,7 +13,7 @@ namespace ClientServer.Helpers /// </summary> public static class Constants { - public static string VersionString = "2.25.1"; + public static string VersionString = "2.25.2"; /// <summary> /// this is only set once at program.cs!! diff --git a/src/ClientServer/Controllers/Core/Exercises/ExerciseEditorController.cs b/src/ClientServer/Controllers/Core/Exercises/ExerciseEditorController.cs index 62331b158bd9837002487396ef094ad41fa7a069..39b6f9ab350715f0a467bf50a6ba861af38e215c 100644 --- a/src/ClientServer/Controllers/Core/Exercises/ExerciseEditorController.cs +++ b/src/ClientServer/Controllers/Core/Exercises/ExerciseEditorController.cs @@ -1771,6 +1771,21 @@ namespace ClientServer.Controllers.Core.Exercises { if (!await base.IsLoggedIn()) return; + for (var i = 0; i < testFromFrontendWithData.Files.Count; i++) + { + var file = testFromFrontendWithData.Files[i]; + //TODO this is probably not right, we want the same as in setup.cs + //MultipartBodyLengthLimit + if (file.Content.Count > AppConfiguration.MaxUploadFileSizeInByte) + { + await + Response.WriteAsync( + Jc.Serialize(new BasicResponse(ResponseCode.InvalidRequest, + "test asset with index " + i + " too large"))); + return; + } + } + int userId = GetUserId(); List<TestType> allTestTypes = await _context.TestTypes.ToListAsync();