Skip to content

Commit b6caf11

Browse files
Releasing v4.28.1
1 parent b5a1792 commit b6caf11

File tree

16 files changed

+81
-21
lines changed

16 files changed

+81
-21
lines changed

.pubnub.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
---
22
changelog:
3+
-
4+
changes:
5+
-
6+
text: "Ensure proper bytes padding in ArrayBuffer prepared for `cbor-js` library."
7+
type: bug
8+
date: 2020-06-19
9+
version: v4.28.1
310
-
411
changes:
512
-
@@ -840,4 +847,4 @@ supported-platforms:
840847
- "Ubuntu 14.04 and up"
841848
- "Windows 7 and up"
842849
version: "Pubnub Javascript for Node"
843-
version: "4.28.0"
850+
version: "4.28.1"

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [v4.28.1](https://github.com/pubnub/javascript/releases/tag/v4.28.1)
2+
June-19-2020
3+
4+
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.28.0...v4.28.1)
5+
6+
- 🐛 Ensure proper bytes padding in ArrayBuffer prepared for `cbor-js` library.
7+
18
## [v4.28.0](https://github.com/pubnub/javascript/releases/tag/v4.28.0)
29
June-03-2020
310

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ please use the [master_3x](https://github.com/pubnub/javascript/tree/master_3x)
2222

2323

2424

25-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.28.0.min.js
26-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.28.0.js
25+
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.28.1.min.js
26+
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.28.1.js

dist/titanium/pubnub.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! 4.28.0 / Consumer */
1+
/*! 4.28.1 / Consumer */
22
exports["PubNub"] =
33
/******/ (function(modules) { // webpackBootstrap
44
/******/ // The module cache
@@ -506,7 +506,7 @@ var _default = function () {
506506
}, {
507507
key: "getVersion",
508508
value: function getVersion() {
509-
return '4.28.0';
509+
return '4.28.1';
510510
}
511511
}, {
512512
key: "_addPnsdkSuffix",

dist/titanium/pubnub.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pubnub.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! 4.28.0 / Consumer */
1+
/*! 4.28.1 / Consumer */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -516,7 +516,7 @@ var _default = function () {
516516
}, {
517517
key: "getVersion",
518518
value: function getVersion() {
519-
return '4.28.0';
519+
return '4.28.1';
520520
}
521521
}, {
522522
key: "_addPnsdkSuffix",
@@ -1989,17 +1989,32 @@ function base64ToBinary(base64String) {
19891989

19901990
var arrayBuffer = new ArrayBuffer(parsedWordArray.length * 4);
19911991
var view = new Uint8Array(arrayBuffer);
1992+
var filledArrayBuffer = null;
1993+
var zeroBytesCount = 0;
1994+
var byteOffset = 0;
19921995

19931996
for (var wordIdx = 0; wordIdx < parsedWordArray.length; wordIdx += 1) {
19941997
var word = parsedWordArray[wordIdx];
1995-
var byteOffset = wordIdx * 4;
1998+
byteOffset = wordIdx * 4;
19961999
view[byteOffset] = (word & 0xff000000) >> 24;
19972000
view[byteOffset + 1] = (word & 0x00ff0000) >> 16;
19982001
view[byteOffset + 2] = (word & 0x0000ff00) >> 8;
19992002
view[byteOffset + 3] = word & 0x000000ff;
20002003
}
20012004

2002-
return view.buffer;
2005+
for (var byteIdx = byteOffset + 3; byteIdx >= byteOffset; byteIdx -= 1) {
2006+
if (view[byteIdx] === 0) {
2007+
zeroBytesCount += 1;
2008+
}
2009+
}
2010+
2011+
if (zeroBytesCount > 0) {
2012+
filledArrayBuffer = view.buffer.slice(0, view.byteLength - zeroBytesCount);
2013+
} else {
2014+
filledArrayBuffer = view.buffer;
2015+
}
2016+
2017+
return filledArrayBuffer;
20032018
}
20042019

20052020
function stringifyBufferKeys(obj) {

dist/web/pubnub.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/config.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/config.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/utils.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/web/index.js

Lines changed: 17 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)