Skip to content

Commit c5c2947

Browse files
committed
debugging
1 parent ac76cef commit c5c2947

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

utils/request/request.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,18 @@ func GetReqBody(w http.ResponseWriter, req *http.Request) Body {
102102
bytes, err := GetBody(req)
103103

104104
var isEmpty bool
105-
106-
isEmpty = len(bytes) > 0
107-
108-
if isEmpty {
109-
return Body{Empty: true}
110-
}
111105

112106
if err != nil {
113107
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
114108

109+
isEmpty = true
110+
}
111+
112+
if len(bytes) <= 0 {
113+
isEmpty = true
114+
}
115+
116+
if isEmpty {
115117
return Body{Empty: true}
116118
}
117119

0 commit comments

Comments
 (0)