mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-25 22:01:16 +00:00
finished unit tests and docstrings
This commit is contained in:
@@ -16,12 +16,12 @@ namespace MalwareMultiScan.Api.Attributes
|
||||
var maxSize = validationContext
|
||||
.GetRequiredService<IConfiguration>()
|
||||
.GetValue<long>("MaxFileSize");
|
||||
|
||||
|
||||
var formFile = (IFormFile) value;
|
||||
|
||||
|
||||
if (formFile == null || formFile.Length > maxSize)
|
||||
return new ValidationResult($"File exceeds the maximum size of {maxSize} bytes");
|
||||
|
||||
|
||||
return ValidationResult.Success;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user