Return 400 error not 304 when bad data is passed
This commit is contained in:
parent
cff705f807
commit
a31e805c5a
|
@ -378,15 +378,15 @@ func postServerUploadFiles(c *gin.Context) {
|
||||||
form, err := c.MultipartForm()
|
form, err := c.MultipartForm()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{
|
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{
|
||||||
"error": "Failed to get multipart form.",
|
"error": "Failed to get multipart form data from request.",
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
headers, ok := form.File["files"]
|
headers, ok := form.File["files"]
|
||||||
if !ok {
|
if !ok {
|
||||||
c.AbortWithStatusJSON(http.StatusNotModified, gin.H{
|
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{
|
||||||
"error": "No files were attached to the request.",
|
"error": "No files were found on the request body.",
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user