Skip to content

Commit

Permalink
updated protocol field for responses and emits
Browse files Browse the repository at this point in the history
  • Loading branch information
southbite committed Jun 15, 2017
1 parent 4cb59de commit ff2cb8b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,7 @@
1.13.1 2017-06-15
-----------------
- fixed issue with protocol 1.1.0, protocol field missing

1.13.2 2017-06-15
-----------------
- fixed issue with protocols, protocol field "harded coded in emit and response on all plugins"
2 changes: 1 addition & 1 deletion lib/services/protocol/happn_1.1.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ProtocolHappn.prototype.emit = Promise.promisify(function(message, session, call

if (client) {

message.request.publication.protocol = this.happn.services.protocol.current();
message.request.publication.protocol = "1.1.0";

if (session.isEncrypted) message.request.publication = {encrypted:this.__encryptMessage(message.request.publication, session.secret)};

Expand Down
4 changes: 3 additions & 1 deletion lib/services/protocol/happn_1.2.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ ProtocolHappn.prototype.__createResponse = function (e, message, response, opts)

response._meta = _meta;

response.protocol = "1.2.0";

if (e) {

response._meta.status = 'error';
Expand Down Expand Up @@ -173,7 +175,7 @@ ProtocolHappn.prototype.emit = Promise.promisify(function(message, session, call

if (client) {

message.request.publication.protocol = this.happn.services.protocol.current();
message.request.publication.protocol = "1.2.0";

if (session.isEncrypted) message.request.publication = {encrypted:this.__encryptMessage(message.request.publication, session.secret)};

Expand Down
4 changes: 3 additions & 1 deletion lib/services/protocol/happn_1.3.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ ProtocolHappn.prototype.__createResponse = function (e, message, response, opts)

response._meta = _meta;

response.protocol = "1.3.0";

if (e) {

response._meta.status = 'error';
Expand Down Expand Up @@ -173,7 +175,7 @@ ProtocolHappn.prototype.emit = Promise.promisify(function(message, session, call

if (client) {

message.request.publication.protocol = this.happn.services.protocol.current();
message.request.publication.protocol = "1.3.0";

if (session.isEncrypted) message.request.publication = {encrypted:this.__encryptMessage(message.request.publication, session.secret)};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "happn-3",
"description": "pub/sub api as a service using primus and mongo & redis or nedb, can work as cluster, single process or embedded using nedb",
"version": "1.13.1",
"version": "1.13.2",
"main": "./lib/index",
"protocol": "1.3.0",
"scripts": {
Expand Down

0 comments on commit ff2cb8b

Please sign in to comment.