mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2026-11-12 22:43:13 +00:00
Fix: able to upload empty file
This commit is contained in:
1 parent
948059ec1c
commit
671d031d00
6 files changed
+45
-4
No files matched your search
@@ -36,6 +36,7 @@ func TestFileSystem_ValidateLegalName(t *testing.T) {
|
||||
asserts.False(fs.ValidateLegalName(ctx, "../11.txt"))
|
||||
asserts.False(fs.ValidateLegalName(ctx, "/11.txt"))
|
||||
asserts.False(fs.ValidateLegalName(ctx, "\\11.txt"))
|
||||
asserts.False(fs.ValidateLegalName(ctx, ""))
|
||||
}
|
||||
|
||||
func TestFileSystem_ValidateCapacity(t *testing.T) {
|
||||
@@ -72,6 +73,7 @@ func TestFileSystem_ValidateFileSize(t *testing.T) {
|
||||
asserts.True(fs.ValidateFileSize(ctx, 5))
|
||||
asserts.True(fs.ValidateFileSize(ctx, 10))
|
||||
asserts.False(fs.ValidateFileSize(ctx, 11))
|
||||
asserts.False(fs.ValidateFileSize(ctx, 0))
|
||||
}
|
||||
|
||||
func TestFileSystem_ValidateExtension(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user