Skip to content

Commit

Permalink
feat: Explicitly setting response charset
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidmt committed Dec 9, 2020
1 parent e214443 commit 8340895
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middleware/res-goodbye.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ const bodyByRequestAccept = ({ accept, res }) => {
case "json": {
const payload = read(["ctx", "payload"], {}, res)

res.setHeader("Content-Type", "application/json")
res.setHeader("Content-Type", "application/json; charset=utf-8")

return JSON.stringify(payload)
}

default: {
const payload = read(["ctx", "payload"], "", res)

res.setHeader("Content-Type", "text/plain")
res.setHeader("Content-Type", "text/plain; charset=utf-8")

return payload
}
Expand Down

0 comments on commit 8340895

Please sign in to comment.