fixed file path

This commit is contained in:
Tordarus 2022-01-14 17:41:45 +01:00
parent 83e0b55423
commit 458cf850d2

10
main.go
View File

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