From c2d666b43477ea7042b574ad940c508216cb0e83 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Mon, 3 Jul 2023 23:13:04 +0200 Subject: fix: Fix content type Content type was always being set to `text/html`. Also swap lib for processing thumbnail for something that accepts HEIC. --- pkg/ext/middleware.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/ext/middleware.go') diff --git a/pkg/ext/middleware.go b/pkg/ext/middleware.go index d255c6d..c83b998 100644 --- a/pkg/ext/middleware.go +++ b/pkg/ext/middleware.go @@ -12,7 +12,9 @@ import ( func HTML(next fasthttp.RequestHandler) fasthttp.RequestHandler { return func(ctx *fasthttp.RequestCtx) { - ctx.Response.Header.SetContentType("text/html") + if len(ctx.Request.Header.ContentType()) > 0 { + ctx.Response.Header.SetContentType("text/html") + } next(ctx) } } -- cgit v1.2.3