Skip to content

Commit 2d119e5

Browse files
author
Devendra
committed
fix for infinite ttl on 0
1 parent 1a7c045 commit 2d119e5

20 files changed

Lines changed: 166 additions & 166 deletions

File tree

core/pubnub-common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ function PN_API(setup) {
10721072
+ "r=" + r + "&"
10731073
+ "timestamp=" + encode(timestamp);
10741074

1075-
if (ttl) sign_input += "&" + "ttl=" + ttl;
1075+
if (ttl || ttl === 0) sign_input += "&" + "ttl=" + ttl;
10761076

10771077
sign_input += "&" + "w=" + w;
10781078

@@ -1089,7 +1089,7 @@ function PN_API(setup) {
10891089
'timestamp' : timestamp
10901090
};
10911091

1092-
if (ttl) data['ttl'] = ttl;
1092+
if (ttl || ttl === 0) data['ttl'] = ttl;
10931093
if (auth_key) data['auth'] = auth_key;
10941094

10951095
xdr({

modern/pubnub.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ function PN_API(setup) {
10731073
+ "r=" + r + "&"
10741074
+ "timestamp=" + encode(timestamp);
10751075

1076-
if (ttl) sign_input += "&" + "ttl=" + ttl;
1076+
if (ttl || ttl === 0) sign_input += "&" + "ttl=" + ttl;
10771077

10781078
sign_input += "&" + "w=" + w;
10791079

@@ -1090,7 +1090,7 @@ function PN_API(setup) {
10901090
'timestamp' : timestamp
10911091
};
10921092

1093-
if (ttl) data['ttl'] = ttl;
1093+
if (ttl || ttl === 0) data['ttl'] = ttl;
10941094
if (auth_key) data['auth'] = auth_key;
10951095

10961096
xdr({

modern/pubnub.min.js

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

node.js/pubnub.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ function PN_API(setup) {
10731073
+ "r=" + r + "&"
10741074
+ "timestamp=" + encode(timestamp);
10751075

1076-
if (ttl) sign_input += "&" + "ttl=" + ttl;
1076+
if (ttl || ttl === 0) sign_input += "&" + "ttl=" + ttl;
10771077

10781078
sign_input += "&" + "w=" + w;
10791079

@@ -1090,7 +1090,7 @@ function PN_API(setup) {
10901090
'timestamp' : timestamp
10911091
};
10921092

1093-
if (ttl) data['ttl'] = ttl;
1093+
if (ttl || ttl === 0) data['ttl'] = ttl;
10941094
if (auth_key) data['auth'] = auth_key;
10951095

10961096
xdr({

phonegap/pubnub.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ function PN_API(setup) {
10731073
+ "r=" + r + "&"
10741074
+ "timestamp=" + encode(timestamp);
10751075

1076-
if (ttl) sign_input += "&" + "ttl=" + ttl;
1076+
if (ttl || ttl === 0) sign_input += "&" + "ttl=" + ttl;
10771077

10781078
sign_input += "&" + "w=" + w;
10791079

@@ -1090,7 +1090,7 @@ function PN_API(setup) {
10901090
'timestamp' : timestamp
10911091
};
10921092

1093-
if (ttl) data['ttl'] = ttl;
1093+
if (ttl || ttl === 0) data['ttl'] = ttl;
10941094
if (auth_key) data['auth'] = auth_key;
10951095

10961096
xdr({

phonegap/pubnub.min.js

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

sencha/pubnub.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ function PN_API(setup) {
10731073
+ "r=" + r + "&"
10741074
+ "timestamp=" + encode(timestamp);
10751075

1076-
if (ttl) sign_input += "&" + "ttl=" + ttl;
1076+
if (ttl || ttl === 0) sign_input += "&" + "ttl=" + ttl;
10771077

10781078
sign_input += "&" + "w=" + w;
10791079

@@ -1090,7 +1090,7 @@ function PN_API(setup) {
10901090
'timestamp' : timestamp
10911091
};
10921092

1093-
if (ttl) data['ttl'] = ttl;
1093+
if (ttl || ttl === 0) data['ttl'] = ttl;
10941094
if (auth_key) data['auth'] = auth_key;
10951095

10961096
xdr({

sencha/pubnub.min.js

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

smart-tv/pubnub.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ function PN_API(setup) {
12231223
+ "r=" + r + "&"
12241224
+ "timestamp=" + encode(timestamp);
12251225

1226-
if (ttl) sign_input += "&" + "ttl=" + ttl;
1226+
if (ttl || ttl === 0) sign_input += "&" + "ttl=" + ttl;
12271227

12281228
sign_input += "&" + "w=" + w;
12291229

@@ -1240,7 +1240,7 @@ function PN_API(setup) {
12401240
'timestamp' : timestamp
12411241
};
12421242

1243-
if (ttl) data['ttl'] = ttl;
1243+
if (ttl || ttl === 0) data['ttl'] = ttl;
12441244
if (auth_key) data['auth'] = auth_key;
12451245

12461246
xdr({

smart-tv/pubnub.min.js

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

0 commit comments

Comments
 (0)