File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,10 @@ async function fastifyHelmet (fastify, options) {
4545
4646 // We decorate the reply with a fallback to the route scoped helmet options
4747 return replyDecorators ( request , reply , mergedHelmetConfiguration , enableRouteCSPNonces )
48- } else {
49- // We decorate the reply with a fallback to the global helmet options
50- return replyDecorators ( request , reply , globalConfiguration , enableCSPNonces )
5148 }
49+
50+ // We decorate the reply with a fallback to the global helmet options
51+ return replyDecorators ( request , reply , globalConfiguration , enableCSPNonces )
5252 } )
5353
5454 fastify . addHook ( 'onRequest' , ( request , reply , next ) => {
@@ -69,14 +69,14 @@ async function fastifyHelmet (fastify, options) {
6969 }
7070
7171 return next ( )
72- } else if ( isGlobal ) {
72+ }
73+ if ( isGlobal ) {
7374 // if the plugin is set globally (meaning that all the routes will be decorated)
7475 // As the endpoint, does not have a custom helmet configuration, use the global one.
7576 return buildHelmetOnRoutes ( request , reply , globalConfiguration , enableCSPNonces )
76- } else {
77- // if the plugin is not global we can skip the route
7877 }
7978
79+ // if the plugin is not global we can skip the route
8080 return next ( )
8181 } )
8282}
You can’t perform that action at this time.
0 commit comments