Return 400 error not 304 when bad data is passed

This commit is contained in:
Dane Everitt 2020-09-09 21:12:06 -07:00
parent cff705f807
commit a31e805c5a
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -378,15 +378,15 @@ func postServerUploadFiles(c *gin.Context) {
form, err := c.MultipartForm()
if err != nil {
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{
"error": "Failed to get multipart form.",
"error": "Failed to get multipart form data from request.",
})
return
}
headers, ok := form.File["files"]
if !ok {
c.AbortWithStatusJSON(http.StatusNotModified, gin.H{
"error": "No files were attached to the request.",
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{
"error": "No files were found on the request body.",
})
return
}