Allow some content types to be inlined (#3274)

"Shamelessly" stolen from
https://github.com/matrix-org/synapse/pull/15988
This commit is contained in:
Till 2023-12-12 11:15:50 +01:00 committed by GitHub
parent fd11e65a9d
commit 185ad6b00d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 5 deletions

View file

@ -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")
}