mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-01-02 09:54:26 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5c0608f63 | ||
|
|
39c3f05d21 |
@@ -2110,7 +2110,7 @@ func (h *Handler) sendResponseWithOptions(w common.ResponseWriter, data interfac
|
|||||||
w.SetHeader("Content-Type", "application/json")
|
w.SetHeader("Content-Type", "application/json")
|
||||||
if data == nil {
|
if data == nil {
|
||||||
data = map[string]interface{}{}
|
data = map[string]interface{}{}
|
||||||
w.WriteHeader(http.StatusNoContent)
|
w.WriteHeader(http.StatusPartialContent)
|
||||||
} else {
|
} else {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
}
|
}
|
||||||
@@ -2166,7 +2166,12 @@ func (h *Handler) sendFormattedResponse(w common.ResponseWriter, data interface{
|
|||||||
httpStatus := http.StatusOK
|
httpStatus := http.StatusOK
|
||||||
if data == nil {
|
if data == nil {
|
||||||
data = map[string]interface{}{}
|
data = map[string]interface{}{}
|
||||||
httpStatus = http.StatusNoContent
|
httpStatus = http.StatusPartialContent
|
||||||
|
} else {
|
||||||
|
dataLen := reflection.Len(data)
|
||||||
|
if dataLen == 0 {
|
||||||
|
httpStatus = http.StatusPartialContent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.SingleRecordAsObject {
|
if options.SingleRecordAsObject {
|
||||||
|
|||||||
Reference in New Issue
Block a user