From 8ae06f3a7a399bddd2eac2690e94040dbb600eb3 Mon Sep 17 00:00:00 2001 From: Florent Heyworth Date: Thu, 31 Mar 2022 12:46:04 +0200 Subject: [PATCH] add html utf8 bom signature closes #267 --- internal/magic/text.go | 1 + mimetype_test.go | 1 + testdata/html.utf8bom.html | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 testdata/html.utf8bom.html diff --git a/internal/magic/text.go b/internal/magic/text.go index e2a03caf..f4d50465 100644 --- a/internal/magic/text.go +++ b/internal/magic/text.go @@ -13,6 +13,7 @@ import ( var ( // HTML matches a Hypertext Markup Language file. HTML = markup( + append([]byte{0xEF, 0xBB, 0xBF}, []byte(" + + + + + + + test + + + + + + + + + +
+ +