From a42c10eb7ca47355fa74a0739ddb86830bdfa899 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 25 Aug 2023 23:43:11 +0900 Subject: [PATCH] set charset=utf-8 --- nostrh/cmd/server/server.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nostrh/cmd/server/server.go b/nostrh/cmd/server/server.go index 1145192..8d40ff3 100644 --- a/nostrh/cmd/server/server.go +++ b/nostrh/cmd/server/server.go @@ -36,11 +36,11 @@ func Start(port string) { if ev != nil { switch ev.Kind { case consts.KindWebhostHTML: - ctx.Data(http.StatusOK, "text/html", []byte(ev.Content)) + ctx.Data(http.StatusOK, "text/html; charset=utf-8", []byte(ev.Content)) case consts.KindWebhostCSS: - ctx.Data(http.StatusOK, "text/css", []byte(ev.Content)) + ctx.Data(http.StatusOK, "text/css; charset=utf-8", []byte(ev.Content)) case consts.KindWebhostJS: - ctx.Data(http.StatusOK, "text/javascript", []byte(ev.Content)) + ctx.Data(http.StatusOK, "text/javascript; charset=utf-8", []byte(ev.Content)) case consts.KindWebhostPicture: { eTag := ev.Tags.GetFirst([]string{"e"}) @@ -111,11 +111,11 @@ func Start(port string) { if ev != nil { switch ev.Kind { case consts.KindWebhostReplaceableHTML: - ctx.Data(http.StatusOK, "text/html", []byte(ev.Content)) + ctx.Data(http.StatusOK, "text/html; charset=utf-8", []byte(ev.Content)) case consts.KindWebhostReplaceableCSS: - ctx.Data(http.StatusOK, "text/css", []byte(ev.Content)) + ctx.Data(http.StatusOK, "text/css; charset=utf-8", []byte(ev.Content)) case consts.KindWebhostReplaceableJS: - ctx.Data(http.StatusOK, "text/javascript", []byte(ev.Content)) + ctx.Data(http.StatusOK, "text/javascript; charset=utf-8", []byte(ev.Content)) default: ctx.String(http.StatusNotFound, http.StatusText(http.StatusNotFound)) }