Skip to content

Commit 24733ec

Browse files
author
Tobias Fuhrimann
committed
Merge remote-tracking branch 'upstream/master' into feature/graphiql
2 parents ac89766 + 43051ba commit 24733ec

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ func (h *Handler) ContextHandler(ctx context.Context, w http.ResponseWriter, r *
138138
}
139139
}
140140

141+
// use proper JSON Header
142+
w.Header().Add("Content-Type", "application/json")
143+
141144
if h.pretty {
142145
w.WriteHeader(http.StatusOK)
143146
buff, _ := json.MarshalIndent(result, "", "\t")

handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import (
1010
"strings"
1111
"testing"
1212

13+
"context"
1314
"github.com/graphql-go/graphql"
1415
"github.com/graphql-go/graphql/testutil"
1516
"github.com/graphql-go/handler"
16-
"context"
1717
)
1818

1919
func decodeResponse(t *testing.T, recorder *httptest.ResponseRecorder) *graphql.Result {

0 commit comments

Comments
 (0)