Retrieve file's salted hash depending on request's method DELETE or POST.
This commit is contained in:
parent
20702fa97e
commit
0a6c8e5d49
@ -181,7 +181,13 @@ func (h *UploadHandlers) Download(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *UploadHandlers) Delete(w http.ResponseWriter, r *http.Request) {
|
func (h *UploadHandlers) Delete(w http.ResponseWriter, r *http.Request) {
|
||||||
saltedHash := server.GetURLParam(r, "hash")
|
var saltedHash string
|
||||||
|
if r.Method == "DELETE" {
|
||||||
|
saltedHash = server.GetURLParam(r, "hash")
|
||||||
|
} else {
|
||||||
|
r.ParseForm()
|
||||||
|
saltedHash = r.FormValue("hash")
|
||||||
|
}
|
||||||
|
|
||||||
path := path.Join(h.conf.Uploads.Directory, saltedHash)
|
path := path.Join(h.conf.Uploads.Directory, saltedHash)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user