diff options
Diffstat (limited to 'service/http/uploads_config_test.go')
-rw-r--r-- | service/http/uploads_config_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/service/http/uploads_config_test.go b/service/http/uploads_config_test.go new file mode 100644 index 00000000..e2de97f2 --- /dev/null +++ b/service/http/uploads_config_test.go @@ -0,0 +1,15 @@ +package http + +import ( + "testing" + "github.com/stretchr/testify/assert" +) + +func TestFsConfig_Forbids(t *testing.T) { + cfg := UploadsConfig{Forbid: []string{".php"}} + + assert.True(t, cfg.Forbids("index.php")) + assert.True(t, cfg.Forbids("index.PHP")) + assert.True(t, cfg.Forbids("phpadmin/index.bak.php")) + assert.False(t, cfg.Forbids("index.html")) +} |