File tree Expand file tree Collapse file tree
lib/codeql/ruby/frameworks/http_clients
test/library-tests/frameworks/http_clients Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ private import codeql.ruby.ApiGraphs
1111 * # connection re-use
1212 * connection = Faraday.new("http://example.com")
1313 * connection.get("/").body
14+ *
15+ * connection = Faraday.new(url: "http://example.com")
16+ * connection.get("/").body
1417 * ```
1518 */
1619class FaradayHttpRequest extends HTTP:: Client:: Request:: Range {
@@ -38,7 +41,8 @@ class FaradayHttpRequest extends HTTP::Client::Request::Range {
3841
3942 override DataFlow:: Node getURL ( ) {
4043 result = requestUse .getArgument ( 0 ) or
41- result = connectionUse .( DataFlow:: CallNode ) .getArgument ( 0 )
44+ result = connectionUse .( DataFlow:: CallNode ) .getArgument ( 0 ) or
45+ result = connectionUse .( DataFlow:: CallNode ) .getKeywordArgument ( "url" )
4246 }
4347
4448 override predicate disablesCertificateValidation ( DataFlow:: Node disablingNode ) {
Original file line number Diff line number Diff line change 2929resp9 . body
3030
3131resp10 = connection . post ( "/foo" , some : "data" )
32- resp10 . body
32+ resp10 . body
33+
34+ connection = Faraday . new ( url : "http://example.com" )
35+ resp11 = connection . get ( "/" )
36+ resp11 . body
Original file line number Diff line number Diff line change 2525| Faraday.rb:28:9:28:27 | call to get | Faraday | Faraday.rb:28:24:28:26 | "/" | Faraday.rb:29:1:29:10 | call to body |
2626| Faraday.rb:31:10:31:46 | call to post | Faraday | Faraday.rb:27:26:27:45 | "http://example.com" | Faraday.rb:32:1:32:11 | call to body |
2727| Faraday.rb:31:10:31:46 | call to post | Faraday | Faraday.rb:31:26:31:31 | "/foo" | Faraday.rb:32:1:32:11 | call to body |
28+ | Faraday.rb:35:10:35:28 | call to get | Faraday | Faraday.rb:34:26:34:50 | Pair | Faraday.rb:36:1:36:11 | call to body |
29+ | Faraday.rb:35:10:35:28 | call to get | Faraday | Faraday.rb:34:31:34:50 | "http://example.com" | Faraday.rb:36:1:36:11 | call to body |
30+ | Faraday.rb:35:10:35:28 | call to get | Faraday | Faraday.rb:35:25:35:27 | "/" | Faraday.rb:36:1:36:11 | call to body |
2831| HttpClient.rb:3:9:3:45 | call to get | HTTPClient | HttpClient.rb:3:24:3:44 | "http://example.com/" | HttpClient.rb:4:1:4:10 | call to body |
2932| HttpClient.rb:6:9:6:65 | call to post | HTTPClient | HttpClient.rb:6:25:6:45 | "http://example.com/" | HttpClient.rb:7:1:7:13 | call to content |
3033| HttpClient.rb:9:9:9:64 | call to put | HTTPClient | HttpClient.rb:9:24:9:44 | "http://example.com/" | HttpClient.rb:10:1:10:15 | call to http_body |
You can’t perform that action at this time.
0 commit comments