Merge pull request #87 from b3log/master

rebase
This commit is contained in:
Liang Ding 2014-10-24 23:53:27 +08:00
commit f5c59d4530
2 changed files with 17 additions and 0 deletions

12
main.go
View File

@ -5,6 +5,7 @@ import (
"flag"
"html/template"
"math/rand"
"mime"
"net/http"
"runtime"
"strconv"
@ -275,6 +276,8 @@ func aboutHandler(w http.ResponseWriter, r *http.Request) {
func main() {
runtime.GOMAXPROCS(conf.Wide.MaxProcs)
initMime()
defer glog.Flush()
// IDE
@ -380,3 +383,12 @@ func panicRecover(handler func(w http.ResponseWriter, r *http.Request)) func(w h
handler(w, r)
}
}
// 初始化 mime.
//
// 有的操作系统(例如 Windows XP上运行时根据文件后缀获取不到对应的 mime 类型,会导致响应的 HTTP content-type 不正确。
func initMime() {
mime.AddExtensionType(".css", "text/css")
mime.AddExtensionType(".js", "application/x-javascript")
mime.AddExtensionType(".json", "application/json")
}

5
wide.bat Normal file
View File

@ -0,0 +1,5 @@
go install
wide
pause