Skip to content

Commit

Permalink
fix: #606
Browse files Browse the repository at this point in the history
  • Loading branch information
asabya committed Feb 27, 2024
1 parent 8a4b433 commit b9a592a
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions pkg/api/file_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,10 @@ import (
// @Failure 500 {object} response
// @Router /v1/file/download [post]
func (h *Handler) FileDownloadHandlerPost(w http.ResponseWriter, r *http.Request) {
driveName, isGroup := "", false
keys, ok := r.URL.Query()["groupName"]
if ok || (len(keys) == 1 && len(keys[0]) > 0) {
driveName = keys[0]
isGroup = true
} else {
keys, ok := r.URL.Query()["podName"]
if !ok || len(keys[0]) < 1 {
h.logger.Errorf("download \"podName\" argument missing")
jsonhttp.BadRequest(w, &response{Message: "download: \"podName\" argument missing"})
return
}
driveName = keys[0]
driveName, isGroup := r.FormValue("groupName"), true
if driveName == "" {
isGroup = false
driveName = r.FormValue("podName")
if driveName == "" {
h.logger.Errorf("download: \"podName\" argument missing")
jsonhttp.BadRequest(w, &response{Message: "download: \"podName\" argument missing"})
Expand Down

0 comments on commit b9a592a

Please sign in to comment.