We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 409ad49 commit 7871171Copy full SHA for 7871171
modules/typesniffer/typesniffer_test.go
@@ -56,6 +56,10 @@ func TestIsSvgImage(t *testing.T) {
56
<!-- Multline
57
Comment -->
58
<svg></svg>`)).IsSvgImage())
59
+
60
+ // the DetectContentType should work for incomplete data, because only beginning bytes are used for detection
61
+ assert.True(t, DetectContentType([]byte(`<svg>....`)).IsSvgImage())
62
63
assert.False(t, DetectContentType([]byte{}).IsSvgImage())
64
assert.False(t, DetectContentType([]byte("svg")).IsSvgImage())
65
assert.False(t, DetectContentType([]byte("<svgfoo></svgfoo>")).IsSvgImage())
0 commit comments