replaced file server with writing files manually

This commit is contained in:
Tordarus 2022-01-14 17:27:33 +01:00
parent 1128a10561
commit 83e0b55423

View File

@ -94,7 +94,14 @@ func get(w http.ResponseWriter, r *http.Request) {
return return
} }
fileServer.ServeHTTP(w, r) file, err := os.Open(path)
if err != nil {
handleError(w, r, err)
return
}
defer file.Close()
io.Copy(w, file)
} }
func put(w http.ResponseWriter, r *http.Request) { func put(w http.ResponseWriter, r *http.Request) {