mirror of
https://github.com/studiokaiji/nostr-webhost.git
synced 2026-02-23 07:54:31 +01:00
KindTextFileとKindReplaceableTextFileを追加
This commit is contained in:
@@ -5,7 +5,9 @@ const (
|
||||
KindWebhostHTML = 5392
|
||||
KindWebhostCSS = 5393
|
||||
KindWebhostJS = 5394
|
||||
KindTextFile = 1064
|
||||
KindWebhostReplaceableHTML = 35392
|
||||
KindWebhostReplaceableCSS = 35393
|
||||
KindWebhostReplaceableJS = 35394
|
||||
KindReplaceableTextFile = 30064
|
||||
)
|
||||
|
||||
@@ -3,10 +3,17 @@ package tools
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nbd-wtf/go-nostr"
|
||||
"github.com/studiokaiji/nostr-webhost/hostr/cmd/consts"
|
||||
)
|
||||
|
||||
func GetContentType(kind int) (string, error) {
|
||||
func GetContentType(event nostr.Event) (string, error) {
|
||||
kind := event.Kind
|
||||
|
||||
if kind == "" {
|
||||
|
||||
}
|
||||
|
||||
if kind == consts.KindWebhostHTML || kind == consts.KindWebhostReplaceableHTML {
|
||||
return "text/html; charset=utf-8", nil
|
||||
} else if kind == consts.KindWebhostCSS || kind == consts.KindWebhostReplaceableCSS {
|
||||
|
||||
Reference in New Issue
Block a user