mirror of
https://github.com/nkanaev/yarr.git
synced 2025-07-08 16:00:11 +00:00
fix content-type
This commit is contained in:
parent
6349e97fdf
commit
a2f72a8c42
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user