Skip to content

Commit 3272e7c

Browse files
author
alexadrake
committed
add better response object
1 parent f0129a5 commit 3272e7c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/responseHeaders/service.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ func HandleVendorJsonResponseHeaders(w http.ResponseWriter, r *http.Request) {
1414
return
1515
}
1616

17-
var req interface{}
18-
if err := json.Unmarshal(body, &req); err != nil {
17+
var obj interface{}
18+
19+
err = json.Unmarshal([]byte("{\"name\":\"Panda\"}"), &obj)
20+
if err != nil {
1921
utils.HandleError(w, err)
2022
return
2123
}
2224

2325
w.Header().Set("Content-Type", "application/vnd.api+json; charset=utf-8")
2426

25-
if err := json.NewEncoder(w).Encode(req); err != nil {
27+
if err := json.NewEncoder(w).Encode(obj); err != nil {
2628
utils.HandleError(w, err)
2729
}
2830
}

0 commit comments

Comments
 (0)