check if body is empty in upload route

This commit is contained in:
2026-03-17 12:43:40 +03:00
parent 83ed018bd3
commit 50d62eaa83

View File

@@ -113,6 +113,10 @@ func main() {
return fmt.Errorf("failed to read request body: %v", err)
}
if len(data) == 0 {
return srv.Error("empty body", nil, 400)
}
img := &model.Image{
UserID: user.ID,
Data: data,