summaryrefslogtreecommitdiffstats
path: root/commands/server.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-04 18:05:19 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-04 18:05:19 +0200
commita883948c4fa6d6de9ef2912709b42655c4cead83 (patch)
treeffc83042567246ab31ff302a9ee89877669d00c3 /commands/server.go
parentbc36d468ab56b5bcf01c3dc1478b1818dd17e4ff (diff)
Register all media types when in server mode
Fixes #3274
Diffstat (limited to 'commands/server.go')
-rw-r--r--commands/server.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/commands/server.go b/commands/server.go
index ae51d075d..0e719e17d 100644
--- a/commands/server.go
+++ b/commands/server.go
@@ -24,8 +24,6 @@ import (
"strings"
"time"
- "mime"
-
"github.com/spf13/afero"
"github.com/spf13/cobra"
"github.com/spf13/hugo/config"
@@ -95,9 +93,6 @@ func init() {
serverCmd.RunE = server
- mime.AddExtensionType(".json", "application/json; charset=utf-8")
- mime.AddExtensionType(".css", "text/css; charset=utf-8")
-
}
func server(cmd *cobra.Command, args []string) error {
@@ -168,6 +163,10 @@ func server(cmd *cobra.Command, args []string) error {
return err
}
+ for _, s := range Hugo.Sites {
+ s.RegisterMediaTypes()
+ }
+
// Watch runs its own server as part of the routine
if serverWatch {
watchDirs := c.getDirList()