From 4e7bd3579b2d38c917ed757418ef57130e75e40e Mon Sep 17 00:00:00 2001 From: yusing Date: Tue, 21 Jan 2025 09:36:17 +0800 Subject: [PATCH] fix favicon content type --- internal/api/v1/favicon/favicon.go | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/internal/api/v1/favicon/favicon.go b/internal/api/v1/favicon/favicon.go index 92559bc4..3e86d515 100644 --- a/internal/api/v1/favicon/favicon.go +++ b/internal/api/v1/favicon/favicon.go @@ -67,6 +67,17 @@ func (res *fetchResult) OK() bool { return res.icon != nil } +func (res *fetchResult) ContentType() string { + if res.contentType == "" { + if bytes.HasPrefix(res.icon, []byte("