diff --git a/CHANGELOG.md b/CHANGELOG.md index 36517ba..7b378f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2.2.1] - 2016-06-15 +### Fixed +- Sending email with accents: https://github.com/sendgrid/sendgrid-nodejs/issues/239 +- Thanks [eaparango](https://github.com/eaparango)! + ## [2.2.0] - 2016-06-10 ### Added - Automatically add Content-Type: application/json when there is a request body diff --git a/lib/client.js b/lib/client.js index 5fe49f7..6339a21 100644 --- a/lib/client.js +++ b/lib/client.js @@ -73,7 +73,7 @@ function Client (globalRequest) { // add the request body's content length if (!isEmpty(endpointRequest.body)) { body = JSON.stringify(endpointRequest.body) - request.headers['Content-Length'] = body.length + request.headers['Content-Length'] = Buffer.byteLength(body) request.headers['Content-Type'] = 'application/json' } diff --git a/package.json b/package.json index 763b2e1..d615b93 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ ], "name": "sendgrid-rest", "description": "HTTP REST client, simplified for Node.js.", - "version": "2.2.0", + "version": "2.2.1", "homepage": "https://sendgrid.com", "repository": { "type": "git",