mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-01-03 18:34:25 +00:00
StatusNoContent for zero length data
This commit is contained in:
@@ -2167,6 +2167,11 @@ func (h *Handler) sendFormattedResponse(w common.ResponseWriter, data interface{
|
|||||||
if data == nil {
|
if data == nil {
|
||||||
data = map[string]interface{}{}
|
data = map[string]interface{}{}
|
||||||
httpStatus = http.StatusNoContent
|
httpStatus = http.StatusNoContent
|
||||||
|
} else {
|
||||||
|
dataLen := reflection.Len(data)
|
||||||
|
if dataLen == 0 {
|
||||||
|
httpStatus = http.StatusNoContent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.SingleRecordAsObject {
|
if options.SingleRecordAsObject {
|
||||||
|
|||||||
Reference in New Issue
Block a user