replaced file server with writing files manually
This commit is contained in:
parent
1128a10561
commit
83e0b55423
9
main.go
9
main.go
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user