jsonrpcserver
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "jsonrpcserver", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "JSON-RPC Server (http://www.jsonrpc.org/specification) with endpoints implementation", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -158,3 +158,3 @@ 'use strict'; | ||
//Result | ||
else { | ||
else if(! (!idField && (typeof idField == 'object'))) { //idField != null | ||
response = { | ||
@@ -167,2 +167,5 @@ jsonrpc: "2.0", | ||
//Notification | ||
else httpCode = 204; | ||
//Send response | ||
@@ -169,0 +172,0 @@ this.getResponse().writeHead(httpCode, headers); |
@@ -17,5 +17,4 @@ /** | ||
"E_NOTIFICATION": {httpCode: 204, response: null, name: "E_NOTIFICATION"}, | ||
"E_DISALLOWED_REQUEST_METHOD": {httpCode: 405, response: null, name: "E_DISALLOWED_REQUEST_METHOD"}, | ||
"E_TIMEOUT": {httpCode: 504, response: null, name: "E_TIMEOUT"} | ||
}; |
@@ -192,6 +192,6 @@ 'use strict'; | ||
//if notification | ||
if(request.content && !request.content.hasOwnProperty('id')) isNotification = RpcErrors.E_NOTIFICATION; | ||
if(request.content && !request.content.hasOwnProperty('id')) isNotification = true; | ||
if(!error) this.callMethod(uuid, request.url.path, request.content.method, request.content.params); | ||
if(error || isNotification) this.processResponse(uuid, error || isNotification); | ||
if(error || isNotification) this.processResponse(uuid, error); | ||
}; | ||
@@ -198,0 +198,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
503
22592