Skip to content

Commit e2b4a68

Browse files
committed
add proper JSON header
* use "applicaiton/json" instead of "text/plain; charet=utf-8" as "Content-Type" in header.
1 parent 21daceb commit e2b4a68

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ func (h *Handler) ContextHandler(ctx context.Context, w http.ResponseWriter, r *
129129
}
130130
result := graphql.Do(params)
131131

132+
// use proper JSON Header
133+
w.Header().Add("Content-Type", "application/json")
134+
132135
if h.pretty {
133136
w.WriteHeader(http.StatusOK)
134137
buff, _ := json.MarshalIndent(result, "", "\t")

0 commit comments

Comments
 (0)