diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-07-03 23:13:04 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-07-03 23:13:04 +0200 |
commit | c2d666b43477ea7042b574ad940c508216cb0e83 (patch) | |
tree | a459b552374114c4ef9ebe9966ed6ec83bb9a11d /pkg/ext | |
parent | 6e84441dab0a2b89869e33d7e89d14189d9b67c0 (diff) | |
download | lens-c2d666b43477ea7042b574ad940c508216cb0e83.tar.gz lens-c2d666b43477ea7042b574ad940c508216cb0e83.tar.bz2 lens-c2d666b43477ea7042b574ad940c508216cb0e83.zip |
fix: Fix content type
Content type was always being set to `text/html`.
Also swap lib for processing thumbnail for something that accepts HEIC.
Diffstat (limited to 'pkg/ext')
-rw-r--r-- | pkg/ext/middleware.go | 4 |
1 files changed, 3 insertions, 1 deletions
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) } } |