Skip to content

Commit c47d0fb

Browse files
committed
Ruby: Identify ActionController::API
`ActionController::API < ActionController::Base` is a base controller class, so we should recognise it as such.
1 parent f31a483 commit c47d0fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ruby/ql/lib/codeql/ruby/frameworks/ActionController.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ private DataFlow::ConstRef actionControllerBaseClass() {
110110
// In Rails applications `ApplicationController` typically extends `ActionController::Base`, but we
111111
// treat it separately in case the `ApplicationController` definition is not in the database.
112112
DataFlow::getConstant("ActionController").getConstant("Base"),
113-
// ActionController::Metal technically doesn't contain all of the
113+
// ActionController::Metal and ActionController::API technically don't contain all of the
114114
// methods available in Base, such as those for rendering views.
115-
// However we prefer to be over-sensitive in this case in order to find
116-
// more results.
117-
DataFlow::getConstant("ActionController").getConstant("Metal")
115+
// However we prefer to be over-sensitive in this case in order to find more results.
116+
DataFlow::getConstant("ActionController").getConstant("Metal"),
117+
DataFlow::getConstant("ActionController").getConstant("API")
118118
]
119119
}
120120

0 commit comments

Comments
 (0)