From b374d9827cbd9f2c71fa68bc5267ca4ddb1b422f Mon Sep 17 00:00:00 2001 From: Angel Rodriguez Date: Sun, 14 Jan 2024 11:54:23 -0400 Subject: [PATCH 1/2] fix: deprecation warning --- lib/swsInterface.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/swsInterface.js b/lib/swsInterface.js index 27551e2..6c657b8 100644 --- a/lib/swsInterface.js +++ b/lib/swsInterface.js @@ -173,8 +173,8 @@ function fastifyPlugin (fastify, opts, done) { //let h = Object.getOwnPropertySymbols(reply); //let hh = reply[headersSymbol]; // Set route_path as reply.context.config.url - if(('context' in reply) && ('config' in reply.context) && ('url' in reply.context.config)){ - request.raw.sws.route_path = reply.context.config.url; + if(('context' in reply) && ('config' in reply.routeOptions) && ('url' in reply.routeOptions.config)){ + request.raw.sws.route_path = reply.routeOptions.config.url; } done() }); From 1fa08d65e520a6cbc09dee79432abb0d567c7707 Mon Sep 17 00:00:00 2001 From: Angel Rodriguez Date: Sun, 14 Jan 2024 12:00:21 -0400 Subject: [PATCH 2/2] fix --- lib/swsInterface.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/swsInterface.js b/lib/swsInterface.js index 6c657b8..a01e329 100644 --- a/lib/swsInterface.js +++ b/lib/swsInterface.js @@ -172,8 +172,8 @@ function fastifyPlugin (fastify, opts, done) { // TODO Headers //let h = Object.getOwnPropertySymbols(reply); //let hh = reply[headersSymbol]; - // Set route_path as reply.context.config.url - if(('context' in reply) && ('config' in reply.routeOptions) && ('url' in reply.routeOptions.config)){ + // Set route_path as reply.routeOptions.config.url + if(('routeOptions' in reply) && ('config' in reply.routeOptions) && ('url' in reply.routeOptions.config)){ request.raw.sws.route_path = reply.routeOptions.config.url; } done()