mirror of
https://github.com/studiokaiji/nostr-webhost.git
synced 2026-01-31 20:54:49 +01:00
set charset=utf-8
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user