Permalink
Browse files

Merge pull request #1 from torus/master

fix for UTF-8 string
  • Loading branch information...
2 parents a9e395b + 8aa399d commit d7ddf5738bb2fecf2c0c797da2bbb21f9807ab1f @fabrik42 committed Apr 27, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/pusher.js
View
@@ -31,7 +31,7 @@ module.exports = (function(){
var request = client.request('POST', this.path(), {
'host': this.domain,
'Content-Type': 'application/json',
- 'Content-Length': this.data.length
+ 'Content-Length': new Buffer(this.data).length
});
if(callback) {
@@ -71,7 +71,7 @@ module.exports = (function(){
}
Pusher.prototype.hash = function() {
- return crypto.createHash('md5').update(this.data).digest("hex");
+ return crypto.createHash('md5').update(this.data, 'utf8').digest("hex");
}
Pusher.prototype.signature = function(uri, queryString) {

0 comments on commit d7ddf57

Please sign in to comment.