Skip to content

Commit 17480bd

Browse files
committed
use SplitN
1 parent e1d0158 commit 17480bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/typesniffer/typesniffer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (ct SniffedType) IsBrowsableBinaryType() bool {
7777

7878
// GetMimeType returns the mime type
7979
func (ct SniffedType) GetMimeType() string {
80-
return ct.contentType[:strings.Index(ct.contentType, ";")]
80+
return strings.SplitN(ct.contentType, ";", 2)[0];
8181
}
8282

8383
// DetectContentType extends http.DetectContentType with more content types. Defaults to text/unknown if input is empty.

0 commit comments

Comments
 (0)