fixed file path
This commit is contained in:
parent
83e0b55423
commit
458cf850d2
10
main.go
10
main.go
@ -94,14 +94,8 @@ func get(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
file, err := os.Open(path)
|
r.URL.Path = path
|
||||||
if err != nil {
|
fileServer.ServeHTTP(w, r)
|
||||||
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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user