From fe6a6f2737769070fd64a5192ff685c9c89020bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 23 Sep 2018 23:40:35 +0200 Subject: resource/integrity: Make Data.Integrity be of type template.HTMLAttr --- resource/integrity/integrity.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'resource') diff --git a/resource/integrity/integrity.go b/resource/integrity/integrity.go index bd85a503a..bbb214170 100644 --- a/resource/integrity/integrity.go +++ b/resource/integrity/integrity.go @@ -21,6 +21,7 @@ import ( "encoding/hex" "fmt" "hash" + "html/template" "io" "github.com/gohugoio/hugo/resource" @@ -93,10 +94,9 @@ func (c *Client) Fingerprint(res resource.Resource, algo string) (resource.Resou ) } -func integrity(algo string, sum []byte) string { +func integrity(algo string, sum []byte) template.HTMLAttr { encoded := base64.StdEncoding.EncodeToString(sum) - return fmt.Sprintf("%s-%s", algo, encoded) - + return template.HTMLAttr(fmt.Sprintf("%s-%s", algo, encoded)) } func digest(h hash.Hash) ([]byte, error) { -- cgit v1.2.3