Skip to content

Commit

Permalink
ContentTypeが正常に変わらない問題を解決
Browse files Browse the repository at this point in the history
  • Loading branch information
studiokaiji committed Oct 22, 2023
1 parent 4de6254 commit 240d5de
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions hostr/cmd/tools/getContentType.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ import (
)

func GetContentType(kind int) (string, error) {
switch kind {
case consts.KindWebhostHTML | consts.KindWebhostReplaceableHTML:
if kind == consts.KindWebhostHTML || kind == consts.KindWebhostReplaceableHTML {
return "text/html; charset=utf-8", nil
case consts.KindWebhostCSS | consts.KindWebhostReplaceableCSS:
} else if kind == consts.KindWebhostCSS || kind == consts.KindWebhostReplaceableCSS {
return "text/css; charset=utf-8", nil
case consts.KindWebhostJS | consts.KindWebhostReplaceableJS:
} else if kind == consts.KindWebhostJS || kind == consts.KindWebhostReplaceableJS {
return "text/javascript; charset=utf-8", nil
default:
} else {
return "", fmt.Errorf("Invalid Kind")
}
}

0 comments on commit 240d5de

Please sign in to comment.