Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
support for ie < 9
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeys089 committed Sep 16, 2013
1 parent 25fa3ea commit ef2d6a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ hawk.client = {
return false;
}

hawk.utils.setNtpOffset(attributes.ts - Math.floor(Date.now() / 1000)); // Keep offset at 1 second precision
hawk.utils.setNtpOffset(attributes.ts - Math.floor((new Date()).getTime() / 1000)); // Keep offset at 1 second precision
}
}

Expand Down Expand Up @@ -279,7 +279,7 @@ hawk.client = {
}

if (updateClock !== false) {
hawk.utils.setNtpOffset(message.ts - Math.floor(Date.now() / 1000)); // Keep offset at 1 second precision
hawk.utils.setNtpOffset(message.ts - Math.floor((new Date()).getTime() / 1000)); // Keep offset at 1 second precision
}

return true;
Expand Down Expand Up @@ -383,7 +383,7 @@ hawk.utils = {

now: function () {

return Date.now() + hawk.utils.getNtpOffset();
return (new Date()).getTime() + hawk.utils.getNtpOffset();
},

escapeHeaderAttribute: function (attribute) {
Expand All @@ -397,7 +397,7 @@ hawk.utils = {
return '';
}

return header.split(';')[0].trim().toLowerCase();
return header.split(';')[0].replace(/^\s+|\s+$/g, '').toLowerCase();
},

parseAuthorizationHeader: function (header, keys) {
Expand Down

0 comments on commit ef2d6a2

Please sign in to comment.