aboutsummaryrefslogtreecommitdiff
path: root/pkg/ext
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/ext')
-rw-r--r--pkg/ext/middleware.go4
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)
}
}