Skip to content
Snippets Groups Projects
Commit 09f61e15 authored by Janis Daniel Dähne's avatar Janis Daniel Dähne
Browse files

- added check for test asset size when not using form upload in create exercise test

parent b7c4ee72
No related branches found
No related tags found
No related merge requests found
......@@ -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!!
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment