File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
javascript/ql/lib/semmle/javascript/frameworks Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,9 @@ module Fastify {
175175 AddHookRouteSetup ( ) { this .getMethodName ( ) = "addHook" }
176176
177177 override predicate isMiddlewareSetup ( ) { any ( ) }
178+
179+ /** Gets the route handler that is being registered. */
180+ RouteHandler getARouteHandler ( ) { result = this .getArgument ( 1 ) }
178181 }
179182
180183 /** Gets the name of the `n`th handler function that can be installed a route setup, in order of execution. */
@@ -328,7 +331,8 @@ module Fastify {
328331 ResponseSendArgument ( ) {
329332 this = rh .getAResponseSource ( ) .ref ( ) .getAMethodCall ( "send" ) .getArgument ( 0 )
330333 or
331- this = rh .( DataFlow:: FunctionNode ) .getAReturn ( )
334+ this = rh .( DataFlow:: FunctionNode ) .getAReturn ( ) and
335+ not exists ( AddHookRouteSetup hookSetup | rh = hookSetup .getARouteHandler ( ) )
332336 }
333337
334338 override RouteHandler getRouteHandler ( ) { result = rh }
You can’t perform that action at this time.
0 commit comments