From ceae7c90f2faad7146ed1ea12c087b8bdceae8d7 Mon Sep 17 00:00:00 2001 From: Tim Hingston Date: Thu, 16 Jun 2016 11:41:03 +1000 Subject: [PATCH] add utf-8 to ContentType header --- lib/client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client.js b/lib/client.js index fa72031..d09b5fa 100644 --- a/lib/client.js +++ b/lib/client.js @@ -21,13 +21,13 @@ headers: { Authorization: "Basic " + (new Buffer(config.API_KEY)).toString('base64'), Accept: 'application/xml', - 'Content-Length': (data) ? data.length : 0, + 'Content-Length': (data) ? Buffer.byteLength(data, 'utf-8') : 0, 'User-Agent': "node-recurly/" + pjson.version } }; if (method.toLowerCase() === 'post' || method.toLowerCase() === 'put') { - options.headers['Content-Type'] = 'application/xml'; + options.headers['Content-Type'] = 'application/xml; charset=utf-8'; that.debug(data); } that.debug(options);