From 8423260f58ede935eca8b8c780e212c2f45cb47e Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Mon, 9 Oct 2017 10:10:40 +0200 Subject: [PATCH] gzip: plugin readme content set explicitly Macaron's gzip middleware tries to automatically figure out the content type for a file when gzipped and seems to mostly fail with plugin readmes. This change sets the content type to plain text. Fixes #9344. Ref #5952. --- pkg/api/plugins.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/api/plugins.go b/pkg/api/plugins.go index 042c03f9832..0483b624a30 100644 --- a/pkg/api/plugins.go +++ b/pkg/api/plugins.go @@ -158,7 +158,9 @@ func GetPluginMarkdown(c *middleware.Context) Response { return ApiError(500, "Could not get markdown file", err) } else { - return Respond(200, content) + resp := Respond(200, content) + resp.Header("Content-Type", "text/plain; charset=utf-8") + return resp } }