ContentType更新

This commit is contained in:
hoteas
2018-11-13 15:38:20 +00:00
parent 8c177e45c5
commit 7da74469a5
5 changed files with 242 additions and 534 deletions
+1 -6
View File
@@ -301,12 +301,7 @@ func (this *Application) handler(w http.ResponseWriter, req *http.Request) {
}
//设置header
mimeStr := Substr(path, strings.LastIndex(path, "."), len(path))
//类型判断并设置Content-Type
if value, ok := mimeMaps[mimeStr]; ok {
header.Set("Content-Type", value)
}
delete(header,"Content-Type")
if this.Config.GetInt("debug")!=1{
header.Set("Cache-Control", "public")
}