Skip to content

Commit 0109657

Browse files
author
Devendra
committed
fixing encryption regression, adding unit tests
1 parent 0ec5ccb commit 0109657

File tree

21 files changed

+418
-141
lines changed

21 files changed

+418
-141
lines changed

modern/pubnub.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -894,11 +894,7 @@ function PN_API(setup) {
894894
each( messages[0], function(msg) {
895895
var next = next_callback();
896896
var decrypted_msg = decrypt(msg,CHANNELS[next[1]]['cipher_key']);
897-
try {
898-
next[0]( JSON['parse'](decrypted_msg), messages, next[1], latency );
899-
} catch (e) {
900-
next[0]( decrypted_msg, messages, next[1], latency );
901-
}
897+
next[0]( decrypted_msg, messages, next[1], latency);
902898
});
903899

904900
timeout( _connect, windowing );

modern/pubnub.min.js

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node.js/pubnub.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -894,11 +894,7 @@ function PN_API(setup) {
894894
each( messages[0], function(msg) {
895895
var next = next_callback();
896896
var decrypted_msg = decrypt(msg,CHANNELS[next[1]]['cipher_key']);
897-
try {
898-
next[0]( JSON['parse'](decrypted_msg), messages, next[1], latency );
899-
} catch (e) {
900-
next[0]( decrypted_msg, messages, next[1], latency );
901-
}
897+
next[0]( decrypted_msg, messages, next[1], latency);
902898
});
903899

904900
timeout( _connect, windowing );
@@ -1512,7 +1508,7 @@ function crypto_obj() {
15121508
} catch (e) {
15131509
return null;
15141510
}
1515-
return decrypted;
1511+
return JSON.parse(decrypted);
15161512
}
15171513
}
15181514
}

0 commit comments

Comments
 (0)