Skip to content

Commit

Permalink
adding a quick length fix for Line
Browse files Browse the repository at this point in the history
  • Loading branch information
simalexan committed Feb 13, 2017
1 parent 1726907 commit e957887
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/line/reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function lineReply(replyToken, message, lineChannelAccessToken) {
const options = {
headers: {
'Authorization': `Basic ${lineChannelAccessToken}`,
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(data, 'utf8')
},
body: JSON.stringify(data)
};
Expand Down
3 changes: 2 additions & 1 deletion spec/line/line-reply-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ describe('Line Reply', () => {
path: '/v2/bot/message/reply',
headers: {
'Authorization': `Basic ${lineChannelAccessToken}`,
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(data, 'utf8')
},
body: JSON.stringify(data)
}));
Expand Down

0 comments on commit e957887

Please sign in to comment.