mirror of
				https://github.com/nkanaev/yarr.git
				synced 2025-10-30 06:31:07 +00:00 
			
		
		
		
	fix content-type
This commit is contained in:
		| @@ -10,6 +10,7 @@ import ( | ||||
| 	"fmt" | ||||
| 	"mime" | ||||
| 	"strings" | ||||
| 	"path/filepath" | ||||
| ) | ||||
|  | ||||
| func IndexHandler(rw http.ResponseWriter, req *http.Request) { | ||||
| @@ -33,7 +34,7 @@ func StaticHandler(rw http.ResponseWriter, req *http.Request) { | ||||
| 		return | ||||
| 	} | ||||
| 	defer f.Close() | ||||
| 	rw.Header().Set("Content-Type", mime.TypeByExtension(path)) | ||||
| 	rw.Header().Set("Content-Type", mime.TypeByExtension(filepath.Ext(path))) | ||||
| 	io.Copy(rw, f) | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user