Skip to content

Commit

Permalink
Use Buffer.byteLength to compute the Content-Length header
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmarban committed Dec 11, 2019
1 parent 0e12b78 commit 7d1d755
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [v1.4.2] - 2019-12-11
- [#16](https://github.com/ivanmarban/winston-telegram/issues/16) Use `Buffer.byteLength` to compute the `Content-Length` header.

## [v1.4.1] - 2019-06-22
- Code refactoring.
- Fix custom-format example.

## [v1.4.0] - 2019-05-26
- Replace [Request](https://github.com/request/request) by standard https Node.js lib.
- Fix custom-format example.
Expand Down Expand Up @@ -56,7 +63,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [v0.1.0] - 2015-11-12
- First version.

[unreleased]: https://github.com/ivanmarban/winston-telegram/compare/v1.4.0...1.x
[[unreleased]: https://github.com/ivanmarban/winston-telegram/compare/v1.4.2...1.x
[v1.4.2]: https://github.com/ivanmarban/winston-telegram/compare/v1.4.1...v1.4.2
[v1.4.1]: https://github.com/ivanmarban/winston-telegram/compare/v1.4.0...v1.4.1
[v1.4.0]: https://github.com/ivanmarban/winston-telegram/compare/v1.3.2...v1.4.0
[v1.3.2]: https://github.com/ivanmarban/winston-telegram/compare/v1.3.1...v1.3.2
[v1.3.1]: https://github.com/ivanmarban/winston-telegram/compare/v1.3.0...v1.3.1
Expand Down
2 changes: 1 addition & 1 deletion lib/winston-telegram.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Telegram.prototype.request = function (messageData, callback) {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': messageData.length
'Content-Length': Buffer.byteLength(messageData)
}
},
function (response) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "winston-telegram",
"description": "A Telegram transport for winston",
"version": "1.4.0",
"version": "1.4.2",
"author": "Ivan Marban",
"repository": {
"type": "git",
Expand Down

0 comments on commit 7d1d755

Please sign in to comment.