Skip to content

Commit

Permalink
Fixed token regular expression
Browse files Browse the repository at this point in the history
  • Loading branch information
argon committed Apr 10, 2013
1 parent 46f49e9 commit 424d0f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ Connection.prototype.pushNotification = function (notification, recipient) {
for (var i = recipient.length - 1; i >= 0; i--) {
var token = recipient[i];
if (typeof token == "string") {
token = new Buffer(token.replace(/[^0-9a-f]/g, ""), "hex");
token = new Buffer(token.replace(/[^0-9a-fA-F]/g, ""), "hex");
}
this.bufferNotification({ "notification": notification, "recipient": token });
}
Expand All @@ -556,7 +556,7 @@ Connection.prototype.pushNotification = function (notification, recipient) {
return Errors['missingDeviceToken'];
}
if (typeof recipient == "string") {
recipient = new Buffer(recipient.replace(/[^0-9a-f]/g, ""), "hex");
recipient = new Buffer(recipient.replace(/[^0-9a-fA-F]/g, ""), "hex");
}
this.bufferNotification({"notification":notification, "recipient":recipient});
}
Expand Down

0 comments on commit 424d0f0

Please sign in to comment.