aboutsummaryrefslogtreecommitdiff
path: root/mediaapi/routing/download_test.go
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-12-12 11:15:50 +0100
committerGitHub <noreply@github.com>2023-12-12 11:15:50 +0100
commit185ad6b00de8079fb6a638ed63e392dfe9f2b49f (patch)
treebe06de8a25a18e8966c118a706a7318eb2471988 /mediaapi/routing/download_test.go
parentfd11e65a9d113839177f9f7a32af328a0292b195 (diff)
Allow some content types to be inlined (#3274)
"Shamelessly" stolen from https://github.com/matrix-org/synapse/pull/15988
Diffstat (limited to 'mediaapi/routing/download_test.go')
-rw-r--r--mediaapi/routing/download_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/mediaapi/routing/download_test.go b/mediaapi/routing/download_test.go
new file mode 100644
index 00000000..21f6bfc2
--- /dev/null
+++ b/mediaapi/routing/download_test.go
@@ -0,0 +1,13 @@
+package routing
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func Test_dispositionFor(t *testing.T) {
+ assert.Equal(t, "attachment", contentDispositionFor(""), "empty content type")
+ assert.Equal(t, "attachment", contentDispositionFor("image/svg"), "image/svg")
+ assert.Equal(t, "inline", contentDispositionFor("image/jpeg"), "image/jpg")
+}