summaryrefslogtreecommitdiff
path: root/service/http/uploads_config_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-10 17:04:02 +0300
committerWolfy-J <[email protected]>2018-06-10 17:04:02 +0300
commit3fe85e9d92f5f98337e8f7fd9a14e6b66b9694bd (patch)
tree2575fbba16df4f95dd392f231ad7d7b30a5dd4ef /service/http/uploads_config_test.go
parent4c292ee46f5505b00b16186e8f30e9bc1be25895 (diff)
http service
Diffstat (limited to 'service/http/uploads_config_test.go')
-rw-r--r--service/http/uploads_config_test.go15
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"))
+}