Add json mime extension type
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 6 Mar 2016 13:10:06 +0000 (14:10 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 6 Mar 2016 13:10:06 +0000 (14:10 +0100)
commands/server.go

index 6007d9fe2da74e04cd6435d5a6f25ecd7da2a0e4..124541b9061949b44b24409a250bf047099596db 100644 (file)
@@ -30,6 +30,7 @@ import (
        "github.com/spf13/hugo/hugofs"
        jww "github.com/spf13/jwalterweatherman"
        "github.com/spf13/viper"
+       "mime"
 )
 
 var (
@@ -94,6 +95,8 @@ func init() {
        serverCmd.Flags().String("memstats", "", "log memory usage to this file")
        serverCmd.Flags().Int("meminterval", 100, "interval to poll memory usage (requires --memstats)")
        serverCmd.RunE = server
+
+       mime.AddExtensionType(".json", "application/json; charset=utf8")
 }
 
 func server(cmd *cobra.Command, args []string) error {