Skip to content

Commit c4e6ccd

Browse files
committed
test(api): enhance session message handling tests with additional edge cases and multipart support
1 parent 20507a6 commit c4e6ccd

2 files changed

Lines changed: 595 additions & 0 deletions

File tree

src/server/api/go/internal/modules/handler/session.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,12 @@ func (h *SessionHandler) SendMessage(c *gin.Context) {
420420
return
421421
}
422422

423+
// Validate that we have at least one part
424+
if len(normalizedParts) == 0 {
425+
c.JSON(http.StatusBadRequest, serializer.ParamErr("", errors.New("message must contain at least one part")))
426+
return
427+
}
428+
423429
// Handle file uploads if multipart
424430
fileMap := map[string]*multipart.FileHeader{}
425431
if strings.HasPrefix(ct, "multipart/form-data") {

0 commit comments

Comments
 (0)