File tree Expand file tree Collapse file tree
test/library-tests/frameworks/koa Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -697,12 +697,12 @@ module Express {
697697 /**
698698 * An invocation of the `redirect` method of an HTTP response object.
699699 */
700- private class RedirectInvocation extends HTTP:: RedirectInvocation , MethodCallExpr {
700+ private class RedirectInvocation extends HTTP:: RedirectInvocation , DataFlow :: MethodCallNode {
701701 ResponseSource response ;
702702
703- RedirectInvocation ( ) { this = response .ref ( ) .getAMethodCall ( "redirect" ) . asExpr ( ) }
703+ RedirectInvocation ( ) { this = response .ref ( ) .getAMethodCall ( "redirect" ) }
704704
705- override Expr getUrlArgument ( ) { result = this .getLastArgument ( ) }
705+ override DataFlow :: Node getUrlArgument ( ) { result = this .getLastArgument ( ) }
706706
707707 override RouteHandler getRouteHandler ( ) { result = response .getRouteHandler ( ) }
708708 }
Original file line number Diff line number Diff line change @@ -351,14 +351,12 @@ module Fastify {
351351 /**
352352 * An invocation of the `redirect` method of an HTTP response object.
353353 */
354- private class RedirectInvocation extends HTTP:: RedirectInvocation , MethodCallExpr {
354+ private class RedirectInvocation extends HTTP:: RedirectInvocation , DataFlow :: MethodCallNode {
355355 RouteHandler rh ;
356356
357- RedirectInvocation ( ) {
358- this = rh .getAResponseSource ( ) .ref ( ) .getAMethodCall ( "redirect" ) .asExpr ( )
359- }
357+ RedirectInvocation ( ) { this = rh .getAResponseSource ( ) .ref ( ) .getAMethodCall ( "redirect" ) }
360358
361- override Expr getUrlArgument ( ) { result = this .getLastArgument ( ) }
359+ override DataFlow :: Node getUrlArgument ( ) { result = this .getLastArgument ( ) }
362360
363361 override RouteHandler getRouteHandler ( ) { result = rh }
364362 }
Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ module HTTP {
1212 /**
1313 * A function invocation that causes a redirect response to be sent.
1414 */
15- abstract class RedirectInvocation extends InvokeExpr {
15+ abstract class RedirectInvocation extends DataFlow :: CallNode {
1616 /** Gets the argument specifying the URL to redirect to. */
17- abstract Expr getUrlArgument ( ) ;
17+ abstract DataFlow :: Node getUrlArgument ( ) ;
1818
1919 /** Gets the route handler this redirect occurs in. */
2020 abstract RouteHandler getRouteHandler ( ) ;
Original file line number Diff line number Diff line change @@ -422,12 +422,14 @@ module Koa {
422422 /**
423423 * An invocation of the `redirect` method of an HTTP response object.
424424 */
425- private class RedirectInvocation extends HTTP:: RedirectInvocation , MethodCallExpr {
425+ private class RedirectInvocation extends HTTP:: RedirectInvocation , DataFlow :: MethodCallNode {
426426 RouteHandler rh ;
427427
428- RedirectInvocation ( ) { this .( MethodCallExpr ) .calls ( rh .getAResponseOrContextExpr ( ) , "redirect" ) }
428+ RedirectInvocation ( ) {
429+ this .asExpr ( ) .( MethodCallExpr ) .calls ( rh .getAResponseOrContextExpr ( ) , "redirect" )
430+ } // TODO: Improve this.
429431
430- override Expr getUrlArgument ( ) { result = this .getArgument ( 0 ) }
432+ override DataFlow :: Node getUrlArgument ( ) { result = this .getArgument ( 0 ) }
431433
432434 override RouteHandler getRouteHandler ( ) { result = rh }
433435 }
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ module ServerSideUrlRedirect {
3333 /**
3434 * An HTTP redirect, considered as a sink for `Configuration`.
3535 */
36- class RedirectSink extends Sink , DataFlow :: ValueNode {
37- RedirectSink ( ) { astNode = any ( HTTP:: RedirectInvocation redir ) .getUrlArgument ( ) }
36+ class RedirectSink extends Sink {
37+ RedirectSink ( ) { this = any ( HTTP:: RedirectInvocation redir ) .getUrlArgument ( ) }
3838 }
3939
4040 /**
Original file line number Diff line number Diff line change 11import javascript
22
33query predicate test_RedirectInvocation (
4- HTTP:: RedirectInvocation redirect , Expr url , HTTP:: RouteHandler rh
4+ HTTP:: RedirectInvocation redirect , DataFlow :: Node url , HTTP:: RouteHandler rh
55) {
66 redirect .getUrlArgument ( ) = url and
77 redirect .getRouteHandler ( ) = rh
You can’t perform that action at this time.
0 commit comments