The /books/ handler now use the BOOKS_PATH constant

This commit is contained in:
Las Zenow 2012-10-29 20:59:41 +01:00
parent 4805d926f0
commit 038cac6a62

View file

@ -61,7 +61,7 @@ func bookHandler(w http.ResponseWriter, r *http.Request) {
}
func downloadHandler(w http.ResponseWriter, r *http.Request) {
file := r.URL.Path[1:]
file := BOOKS_PATH + r.URL.Path[len("/books/"):]
db.IncDownload(file)
http.ServeFile(w, r, file)
}