Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit fcacde9

Browse files
committed
Use Buffer.byteLength to calculate Content-Length
1 parent 2dd170d commit fcacde9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ Client.prototype = {
245245
body = prepareBody(options.body, headers);
246246
}
247247

248-
headers['Content-Length'] = body ? body.length : 0;
248+
headers['Content-Length'] = body ? Buffer.byteLength(body) : 0;
249249

250250
if (this.access_token && !options.auth) {
251251
headers['Authorization'] = "Bearer " + this.access_token

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "Netlify",
33
"name": "netlify",
44
"description": "Netlify API client",
5-
"version": "0.2.3",
5+
"version": "0.2.4",
66
"bugs": {
77
"url": "https://github.com/netlify/netlify-js/issues"
88
},

0 commit comments

Comments
 (0)