@@ -24,14 +24,14 @@ const requestContext = {
2424 } ,
2525}
2626
27- function fastifyRequestContext ( fastify , opts , next ) {
27+ function fastifyRequestContext ( fastify , opts , next ) {
2828 fastify . decorate ( 'requestContext' , requestContext )
2929 fastify . decorateRequest ( 'requestContext' , { getter : ( ) => requestContext } )
3030 fastify . decorateRequest ( asyncResourceSymbol , null )
3131 const hook = opts . hook || 'onRequest'
3232 const hasDefaultStoreValuesFactory = typeof opts . defaultStoreValues === 'function'
3333
34- fastify . addHook ( hook , function requestContextHook ( req , _res , done ) {
34+ fastify . addHook ( hook , function requestContextHook ( req , _res , done ) {
3535 const defaultStoreValues = hasDefaultStoreValuesFactory
3636 ? opts . defaultStoreValues ( req )
3737 : opts . defaultStoreValues
@@ -51,7 +51,7 @@ function fastifyRequestContext(fastify, opts, next) {
5151 // in a different async context, as req/res may emit events in a different context.
5252 // Related to https://github.com/nodejs/node/issues/34430 and https://github.com/nodejs/node/issues/33723
5353 if ( hook === 'onRequest' || hook === 'preParsing' ) {
54- fastify . addHook ( 'preValidation' , function requestContextPreValidationHook ( req , _res , done ) {
54+ fastify . addHook ( 'preValidation' , function requestContextPreValidationHook ( req , _res , done ) {
5555 const asyncResource = req [ asyncResourceSymbol ]
5656 asyncResource . runInAsyncScope ( done , req . raw )
5757 } )
0 commit comments