Skip to content

Commit 6a6655b

Browse files
committed
more debugging
1 parent ba70a35 commit 6a6655b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

utils/request/request.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"net/http"
88
"strings"
99

10+
"github.com/codeshelldev/secured-signal-api/utils"
1011
"github.com/codeshelldev/secured-signal-api/utils/logger"
1112
"github.com/codeshelldev/secured-signal-api/utils/query"
1213
)
@@ -53,8 +54,6 @@ func CreateBody(data map[string]any) (Body, error) {
5354
}
5455

5556
func GetJsonData(body []byte) (map[string]any, error) {
56-
logger.Dev(string(body))
57-
5857
var data map[string]any
5958

6059
err := json.Unmarshal(body, &data)
@@ -136,6 +135,8 @@ func GetReqBody(w http.ResponseWriter, req *http.Request) (Body, error) {
136135

137136
isEmpty = len(data) <= 0
138137

138+
logger.Dev(utils.ToJson(data))
139+
139140
return Body{
140141
Raw: bytes,
141142
Data: data,
@@ -146,6 +147,8 @@ func GetReqBody(w http.ResponseWriter, req *http.Request) (Body, error) {
146147
func GetBodyType(req *http.Request) BodyType {
147148
contentType := req.Header.Get("Content-Type")
148149

150+
logger.Dev(contentType)
151+
149152
switch {
150153
case strings.HasPrefix(contentType, "application/json"):
151154
return Json

0 commit comments

Comments
 (0)