ContentType更新
This commit is contained in:
+1
-6
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user