We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
getACapture
1 parent 870c6d7 commit 751d8a7Copy full SHA for 751d8a7
ruby/ql/lib/codeql/ruby/frameworks/ActionDispatch.qll
@@ -161,6 +161,16 @@ module ActionDispatch {
161
result = call.getKeywordArgument("module").getValueText()
162
}
163
164
+ /**
165
+ * Get a URL capture. This is a wildcard URL segment whose value is placed in `params`.
166
+ * For example, in
167
+ * ```ruby
168
+ * get "/foo/:bar/baz", to: "users#index"
169
+ * ```
170
+ * the capture is `:bar`.
171
+ * We don't currently make use of this, but it may be useful in future to more accurately
172
+ * model the contents of the `params` hash.
173
+ */
174
string getACapture() { result = getPathComponent().regexpFind(":[^:/]+", _, _) }
175
176
0 commit comments