File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ const makeSureBodyExistsAndCanBeChecked = (ctx: IResponseContext) => {
5656 *
5757 * @param {IResponseContext & ParameterizedContext } ctx - Koa context containing status and body.
5858 */
59- export const jsonRpcComplianceLayer = async ( ctx : IResponseContext & ParameterizedContext ) => {
59+ export const jsonRpcComplianceLayer = ( ctx : IResponseContext & ParameterizedContext ) => {
6060 if ( ! makeSureBodyExistsAndCanBeChecked ( ctx ) ) return ;
6161 if ( ctx . status === 400 ) {
6262 if ( ! ctx . body . error || ! ctx . body . error . code ) ctx . body . error = FALLBACK_RESPONSE_BODY . error ;
Original file line number Diff line number Diff line change @@ -309,13 +309,11 @@ export async function initializeServer() {
309309
310310 const rpcApp = koaJsonRpc . rpcApp ( ) ;
311311
312- app . use ( async ( ctx , next ) => {
312+ app . use ( async ( ctx ) => {
313313 await rpcApp ( ctx ) ;
314- await next ( ) ;
314+ jsonRpcComplianceLayer ( ctx ) ;
315315 } ) ;
316316
317- app . use ( jsonRpcComplianceLayer ) ;
318-
319317 process . on ( 'unhandledRejection' , ( reason , p ) => {
320318 logger . error ( `Unhandled Rejection at: Promise: ${ JSON . stringify ( p ) } , reason: ${ reason } ` ) ;
321319 } ) ;
You can’t perform that action at this time.
0 commit comments