Use common readandservefile function (can handle large files)

This commit is contained in:
Gabriel Simmer 2019-02-24 11:16:40 -08:00
parent 053148e4b6
commit f9023d0c4d
No known key found for this signature in database
GPG key ID: 0394452F45EF2817

View file

@ -112,9 +112,8 @@ func ViewFile(tier string) common.Handler {
if err != nil { if err != nil {
panic(err) panic(err)
} }
file, err := ioutil.ReadFile(path)
w.Write(file) common.ReadAndServeFile(path, w)
return nil return nil
} }