Skip to content

Commit

Permalink
fix isProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Jun 15, 2023
1 parent cea1d6f commit c13a165
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ export default function (options: StartOptions) {
// next will call the next middleware
function logMiddleware<ServerParams=void>(next: JSONRPCServerMiddlewareNext<ServerParams>, request: JSONRPCRequest, serverParams: ServerParams) {
prometheus.requests.received?.inc();
const isProxy = server.hasMethod(request.method);
const isProxy = !server.hasMethod(request.method);
if ( isProxy ) logger.info('🔀 proxy::received:' + request.method, request);
else logger.info('log::received:' + request.method, request);
return next(request, serverParams).then(response => {
if ( response ) {
if (isProxy ) logger.info('🔀 proxy::response:' + request.method, response);
if ( isProxy ) logger.info('🔀 proxy::response:' + request.method, response);
else logger.info('log::response:' + request.method, response);
prometheus.requests.response?.inc();
return response;
Expand Down

0 comments on commit c13a165

Please sign in to comment.