buzz-me-in 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/stream-auth.js +4 -4
package/package.json
CHANGED
package/src/core/stream-auth.js
CHANGED
|
@@ -10,14 +10,14 @@ const STREAM_TOKEN_VERSION = 1;
|
|
|
10
10
|
const STREAM_PATH = '/media';
|
|
11
11
|
const pendingStreamNonces = new Map();
|
|
12
12
|
|
|
13
|
+
// Node's native base64url is unpadded RFC 4648 §5, the same format the old
|
|
14
|
+
// replace() chain produced, so tokens issued before this change still verify.
|
|
13
15
|
function toBase64Url(buffer) {
|
|
14
|
-
return buffer.toString('
|
|
16
|
+
return buffer.toString('base64url');
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
function fromBase64Url(value) {
|
|
18
|
-
|
|
19
|
-
const padded = normalized + '='.repeat((4 - (normalized.length % 4)) % 4);
|
|
20
|
-
return Buffer.from(padded, 'base64');
|
|
20
|
+
return Buffer.from(value, 'base64url');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function pruneExpiredNonces() {
|