Skip to content

Commit f9cee1d

Browse files
committed
...
Who knew that `curl` wouldn't be able to identify / add Content-Type automatically... Debugging was for nothing...
1 parent 6a6655b commit f9cee1d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

utils/request/request.go

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

10-
"github.com/codeshelldev/secured-signal-api/utils"
11-
"github.com/codeshelldev/secured-signal-api/utils/logger"
1210
"github.com/codeshelldev/secured-signal-api/utils/query"
1311
)
1412

@@ -135,8 +133,6 @@ func GetReqBody(w http.ResponseWriter, req *http.Request) (Body, error) {
135133

136134
isEmpty = len(data) <= 0
137135

138-
logger.Dev(utils.ToJson(data))
139-
140136
return Body{
141137
Raw: bytes,
142138
Data: data,
@@ -147,8 +143,6 @@ func GetReqBody(w http.ResponseWriter, req *http.Request) (Body, error) {
147143
func GetBodyType(req *http.Request) BodyType {
148144
contentType := req.Header.Get("Content-Type")
149145

150-
logger.Dev(contentType)
151-
152146
switch {
153147
case strings.HasPrefix(contentType, "application/json"):
154148
return Json
@@ -159,6 +153,6 @@ func GetBodyType(req *http.Request) BodyType {
159153
case strings.HasPrefix(contentType, "application/x-www-form-urlencoded"):
160154
return Form
161155
default:
162-
return Json
156+
return Unknown
163157
}
164158
}

0 commit comments

Comments
 (0)