Skip to content

Commit

Permalink
utf8 encode JSON payload in Node (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuap authored Jan 29, 2021
1 parent d508e2c commit 80d7a80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased][latest]
### Fixed
- utf8 encode JSON payload in Node

## [3.0.1] - 2021-01-20
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Honeybadger extends Client {
getStats((stats: Record<string, unknown>) => {
payload.server.stats = stats

const data = JSON.stringify(sanitize(payload, this.config.maxObjectDepth))
const data = Buffer.from(JSON.stringify(sanitize(payload, this.config.maxObjectDepth)), 'utf8')
const options = {
method: 'POST',
headers: {
Expand Down

0 comments on commit 80d7a80

Please sign in to comment.