Skip to content

Commit 30a5252

Browse files
authored
Merge pull request #9 from oxygens/master
License and badge fixes.
2 parents 9c9e503 + 096fd2a commit 30a5252

File tree

12 files changed

+52
-27
lines changed

12 files changed

+52
-27
lines changed

README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Bidirectional JSON-RPC 2.0 server and client
22

3-
[![Version npm](https://img.shields.io/npm/v/ws.svg)](https://www.npmjs.com/package/jsonrpc-bidirectional)
3+
[![Version npm](https://img.shields.io/npm/v/jsonrpc-bidirectional.svg)](https://www.npmjs.com/package/jsonrpc-bidirectional)
44
[![Linux build](https://travis-ci.org/oxygens/jsonrpc-bidirectional.svg?branch=master)](https://travis-ci.org/oxygens/jsonrpc-bidirectional)
55
[![Windows Build](https://ci.appveyor.com/api/projects/status/github/oxygens/jsonrpc-bidirectional?branch=master&svg=true)](https://ci.appveyor.com/project/oxygens/jsonrpc-bidirectional)
66

builds/browser/es5/jsonrpc.min.js

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

builds/browser/es5/jsonrpc.min.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.

builds/browser/es7/jsonrpc.min.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10290,7 +10290,7 @@ module.exports = class IncomingRequest {
1029010290
}
1029110291

1029210292
set bidirectionalWebsocketRouter(bidirectionalWebsocketRouter) {
10293-
assert(bidirectionalWebsocketRouter.constructor.name === "BidirectionalWebsocketRouter");
10293+
assert(bidirectionalWebsocketRouter.constructor.name === "BidirectionalWebsocketRouter", "bidirectionalWebsocketRouter must be an instance of BidirectionalWebsocketRouter.");
1029410294

1029510295
this._bidirectionalWebsocketRouter = bidirectionalWebsocketRouter;
1029610296
}
@@ -12864,7 +12864,7 @@ module.exports = class BidirectionalWebsocketRouter extends EventEmitter {
1286412864
}
1286512865

1286612866
connectionIDToSingletonClient(nConnectionID, ClientClass) {
12867-
assert(typeof nConnectionID === "number");
12867+
assert(typeof nConnectionID === "number", "nConnectionID must be a number. Received this: " + JSON.stringify(nConnectionID));
1286812868
assert(typeof ClientClass === "function", "Invalid ClientClass value: " + typeof ClientClass);
1286912869

1287012870
if (!this._objSessions.hasOwnProperty(nConnectionID)) {
@@ -13496,9 +13496,9 @@ JSONRPC.ServerPluginBase = __webpack_require__(15);
1349613496
module.exports = class DebugLogger extends JSONRPC.ServerPluginBase {
1349713497
async beforeJSONDecode(incomingRequest) {
1349813498
if (incomingRequest.requestBody.length > 1024 * 1024) {
13499-
console.log("[" + process.pid + "] [" + new Date().toISOString() + "] Received JSONRPC request at endpoint path" + incomingRequest.endpoint.path + ", " + incomingRequest.requestObject.method + "(). Larger than 1 MB, not logging. \n");
13499+
console.log("[" + process.pid + "] [" + new Date().toISOString() + "] Received JSONRPC request at endpoint path " + incomingRequest.endpoint.path + ", " + incomingRequest.requestObject.method + "(). Larger than 1 MB, not logging. \n");
1350013500
} else {
13501-
console.log("[" + process.pid + "] [" + new Date().toISOString() + "] Received JSONRPC request at endpoint path" + incomingRequest.endpoint.path + ": " + incomingRequest.requestBody + "\n");
13501+
console.log("[" + process.pid + "] [" + new Date().toISOString() + "] Received JSONRPC request at endpoint path " + incomingRequest.endpoint.path + ": " + incomingRequest.requestBody + "\n");
1350213502
}
1350313503
}
1350413504

builds/browser/es7/jsonrpc.min.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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jsonrpc-bidirectional",
33
"description": "Bidirectional JSONRPC over web sockets or HTTP with extensive plugin support.",
4-
"version": "2.4.5",
4+
"version": "2.4.12",
55
"scripts": {
66
"build": "node build.js",
77
"test": "node tests/main.js",

src/BidirectionalWebsocketRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class BidirectionalWebsocketRouter extends EventEmitter
132132
*/
133133
connectionIDToSingletonClient(nConnectionID, ClientClass)
134134
{
135-
assert(typeof nConnectionID === "number");
135+
assert(typeof nConnectionID === "number", "nConnectionID must be a number. Received this: " + JSON.stringify(nConnectionID));
136136
assert(typeof ClientClass === "function", "Invalid ClientClass value: " + (typeof ClientClass));
137137

138138
if(!this._objSessions.hasOwnProperty(nConnectionID))

src/Plugins/Server/DebugLogger.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class DebugLogger extends JSONRPC.ServerPluginBase
1313
{
1414
if(incomingRequest.requestBody.length > 1024 * 1024)
1515
{
16-
console.log("[" + process.pid + "] [" + (new Date()).toISOString() + "] Received JSONRPC request at endpoint path" + incomingRequest.endpoint.path + ", " + incomingRequest.requestObject.method + "(). Larger than 1 MB, not logging. \n");
16+
console.log("[" + process.pid + "] [" + (new Date()).toISOString() + "] Received JSONRPC request at endpoint path " + incomingRequest.endpoint.path + ", " + incomingRequest.requestObject.method + "(). Larger than 1 MB, not logging. \n");
1717
}
1818
else
1919
{
20-
console.log("[" + process.pid + "] [" + (new Date()).toISOString() + "] Received JSONRPC request at endpoint path" + incomingRequest.endpoint.path + ": " + incomingRequest.requestBody + "\n");
20+
console.log("[" + process.pid + "] [" + (new Date()).toISOString() + "] Received JSONRPC request at endpoint path " + incomingRequest.endpoint.path + ": " + incomingRequest.requestBody + "\n");
2121
}
2222
}
2323

tests/AllTests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ class AllTests
272272
"error",
273273
(error) => {
274274
console.error(error);
275-
process.exit(1);
275+
//process.exit(1); // Why did I put this here?
276+
throw error;
276277
}
277278
);
278279

tests/Browser/TestEndpoint.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/* eslint-disable */
33

44
/**
5+
* Keep everything IE10 compatible, so it can be tested there as well.
6+
*
57
* @class
68
*/
79
function TestEndpoint()
@@ -10,7 +12,7 @@ function TestEndpoint()
1012
this,
1113
[
1214
/*strName*/ "Test",
13-
/*strPath*/ location.protocol + "//" + location.host + '/api', // /api, replaced / with \x2F because issues.
15+
/*strPath*/ location.protocol + "//" + location.host + "/api",
1416
/*objReflection*/ {},
1517
/*classReverseCallsClient*/ JSONRPC.Client
1618
]

0 commit comments

Comments
 (0)