Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #69 from gillesdemey/feature-utf8
Browse files Browse the repository at this point in the history
Explicitly use utf-8 character set for JSON encoding
  • Loading branch information
tedeh committed Feb 15, 2016
2 parents 97a6368 + 516899e commit f10fe8e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/client/http.js
Expand Up @@ -41,7 +41,7 @@ ClientHttp.prototype._request = function(request, callback) {

var headers = {
"Content-Length": Buffer.byteLength(body, options.encoding),
"Content-Type": "application/json",
"Content-Type": "application/json; charset=utf-8",
"Accept": "application/json"
};

Expand Down
2 changes: 1 addition & 1 deletion lib/server/middleware.js
Expand Up @@ -35,7 +35,7 @@ var Middleware = function(server, outerOptions) {
if(body) {
var headers = {
"Content-Length": Buffer.byteLength(body, options.encoding),
"Content-Type": "application/json"
"Content-Type": "application/json; charset=utf-8"
};
res.writeHead(200, headers);
res.write(body);
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Expand Up @@ -190,7 +190,7 @@ Utils.getHttpListener = function(self, server) {

var headers = {
"Content-Length": Buffer.byteLength(body, options.encoding),
"Content-Type": "application/json"
"Content-Type": "application/json; charset=utf-8"
};
res.writeHead(200, headers);
res.end(body);
Expand Down

0 comments on commit f10fe8e

Please sign in to comment.