fix(backend-http): check nil MultipartForm
This commit is contained in:
parent
bc249730f0
commit
9734564da2
1 changed files with 4 additions and 0 deletions
|
|
@ -154,6 +154,10 @@ func iosImagesUploadHandler(w http.ResponseWriter, r *http.Request) {
|
|||
responseWithError(w, http.StatusInternalServerError, err) // TODO: send error here only on staging
|
||||
}
|
||||
|
||||
if (r.MultipartForm == nil) {
|
||||
responseWithError(w, http.StatusInternalServerError, errors.New("Multipart not parsed"))
|
||||
}
|
||||
|
||||
if len(r.MultipartForm.Value["projectKey"]) == 0 {
|
||||
responseWithError(w, http.StatusBadRequest, errors.New("projectKey parameter missing")) // status for missing/wrong parameter?
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue