Skip to content

Commit

Permalink
Merge pull request #10 from asdofindia/fix-json-header
Browse files Browse the repository at this point in the history
Fix: Incorrect header for JSON response
  • Loading branch information
knadh committed Apr 4, 2021
2 parents 7c2fc2a + 93d5eaa commit d64b273
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/dictmaker/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ func validateSearchQuery(q search.Query, l Languages) error {

// sendResponse sends a JSON envelope to the HTTP response.
func sendResponse(data interface{}, status int, w http.ResponseWriter) {
w.WriteHeader(status)
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.WriteHeader(status)

out, err := json.Marshal(httpResp{Status: "success", Data: data})
if err != nil {
Expand Down

0 comments on commit d64b273

Please sign in to comment.