StatusNoContent for zero length data

This commit is contained in:
Hein
2025-12-18 13:34:07 +02:00
parent 4ecd1ac17e
commit 39c3f05d21

View File

@@ -2167,6 +2167,11 @@ func (h *Handler) sendFormattedResponse(w common.ResponseWriter, data interface{
if data == nil {
data = map[string]interface{}{}
httpStatus = http.StatusNoContent
} else {
dataLen := reflection.Len(data)
if dataLen == 0 {
httpStatus = http.StatusNoContent
}
}
if options.SingleRecordAsObject {