jsonrpcserver
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "jsonrpcserver", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "JSON-RPC Server (http://www.jsonrpc.org/specification) with endpoints implementation", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -79,3 +79,3 @@ 'use strict'; | ||
catch(e) { | ||
this.logger.warn('JSON-RPC entity: request parse error:', this.raw.join('')); | ||
this.logger.warn('JSON-RPC entity: request parse error:', this.raw.join('') || '[empty request data]'); | ||
} | ||
@@ -159,3 +159,3 @@ | ||
//Result | ||
else if(data) { | ||
else { | ||
response = { | ||
@@ -168,5 +168,2 @@ jsonrpc: "2.0", | ||
//Notifications | ||
else httpCode = 204; | ||
//Send response | ||
@@ -173,0 +170,0 @@ this.getResponse().writeHead(httpCode, headers); |
@@ -17,4 +17,5 @@ /** | ||
"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 = true; | ||
if(request.content && !request.content.hasOwnProperty('id')) isNotification = RpcErrors.E_NOTIFICATION; | ||
if(!error) this.callMethod(uuid, request.url.path, request.content.method, request.content.params); | ||
if(error || isNotification) this.processResponse(uuid, error); | ||
if(error || isNotification) this.processResponse(uuid, error || isNotification); | ||
}; | ||
@@ -198,0 +198,0 @@ |
Sorry, the diff of this file is not supported yet
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
22611
502