File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ async function fastifyHelmet (fastify, options) {
3535
3636 fastify . addHook ( 'onRequest' , async ( request , reply ) => {
3737 /* istanbul ignore next */
38- const { helmet : routeOptions } = request . routeConfig || request . context . config
38+ const { helmet : routeOptions } = request . routeOptions . config || request . context . config
3939
4040 if ( typeof routeOptions !== 'undefined' ) {
4141 const { enableCSPNonces : enableRouteCSPNonces , skipRoute, ...helmetRouteConfiguration } = routeOptions
@@ -52,7 +52,7 @@ async function fastifyHelmet (fastify, options) {
5252
5353 fastify . addHook ( 'onRequest' , ( request , reply , next ) => {
5454 /* istanbul ignore next */
55- const { helmet : routeOptions } = request . routeConfig || request . context . config
55+ const { helmet : routeOptions } = request . routeOptions . config || request . context . config
5656
5757 if ( typeof routeOptions !== 'undefined' ) {
5858 const { enableCSPNonces : enableRouteCSPNonces , skipRoute, ...helmetRouteConfiguration } = routeOptions
Original file line number Diff line number Diff line change @@ -685,7 +685,7 @@ test('It should not return a fastify `FST_ERR_REP_ALREADY_SENT - Reply already s
685685 }
686686
687687 // We want to crash in the scope of this test
688- const crash = request . routeConfig . fail
688+ const crash = request . routeOptions . config . fail
689689
690690 Promise . resolve ( crash ) . then ( ( fail ) => {
691691 if ( fail === true ) {
You can’t perform that action at this time.
0 commit comments