This commit is contained in:
parent
730e8441ef
commit
b0d2e17b06
@ -263,7 +263,7 @@ func (this *Application) handler(w http.ResponseWriter, req *http.Request) {
|
|||||||
|
|
||||||
//设置header
|
//设置header
|
||||||
mimeStr := Substr(path, strings.LastIndex(path, "."), len(path))
|
mimeStr := Substr(path, strings.LastIndex(path, "."), len(path))
|
||||||
//fmt.Println(mimeStr)
|
|
||||||
|
|
||||||
//类型判断并设置Content-Type
|
//类型判断并设置Content-Type
|
||||||
if value, ok := mimeMaps[mimeStr]; ok {
|
if value, ok := mimeMaps[mimeStr]; ok {
|
||||||
|
21
mime.go
21
mime.go
@ -1,16 +1,3 @@
|
|||||||
// Copyright 2014 beego Author. All Rights Reserved.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package hotime
|
package hotime
|
||||||
|
|
||||||
@ -78,7 +65,7 @@ var mimeMaps = map[string]string{
|
|||||||
".crt": "application/pkix-cert",
|
".crt": "application/pkix-cert",
|
||||||
".crx": "application/x-chrome-extension",
|
".crx": "application/x-chrome-extension",
|
||||||
".csh": "text/x-scriptcsh",
|
".csh": "text/x-scriptcsh",
|
||||||
".css": "text/css",
|
".css": "text/css;charset=utf-8",
|
||||||
".csv": "text/csv",
|
".csv": "text/csv",
|
||||||
".cxx": "text/plain",
|
".cxx": "text/plain",
|
||||||
".dar": "application/x-dar",
|
".dar": "application/x-dar",
|
||||||
@ -149,8 +136,8 @@ var mimeMaps = map[string]string{
|
|||||||
".hqx": "application/binhex",
|
".hqx": "application/binhex",
|
||||||
".hta": "application/hta",
|
".hta": "application/hta",
|
||||||
".htc": "text/x-component",
|
".htc": "text/x-component",
|
||||||
".htm": "text/html",
|
".htm": "text/html;charset=utf-8",
|
||||||
".html": "text/html",
|
".html": "text/html;charset=utf-8",
|
||||||
".htmls": "text/html",
|
".htmls": "text/html",
|
||||||
".htt": "text/webviewhtml",
|
".htt": "text/webviewhtml",
|
||||||
".htx": "text/html",
|
".htx": "text/html",
|
||||||
@ -184,7 +171,7 @@ var mimeMaps = map[string]string{
|
|||||||
".jpeg": "image/jpeg",
|
".jpeg": "image/jpeg",
|
||||||
".jpg": "image/jpeg",
|
".jpg": "image/jpeg",
|
||||||
".jps": "image/x-jps",
|
".jps": "image/x-jps",
|
||||||
".js": "application/javascript",
|
".js": "application/javascript;charset=utf-8",
|
||||||
".json": "application/json",
|
".json": "application/json",
|
||||||
".jut": "image/jutvision",
|
".jut": "image/jutvision",
|
||||||
".kar": "audio/midi",
|
".kar": "audio/midi",
|
||||||
|
Loading…
Reference in New Issue
Block a user