File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
lib/codeql/ruby/frameworks/http_clients
test/library-tests/frameworks/http_clients Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ private import codeql.ruby.ApiGraphs
11
11
* # connection re-use
12
12
* connection = Faraday.new("http://example.com")
13
13
* connection.get("/").body
14
+ *
15
+ * connection = Faraday.new(url: "http://example.com")
16
+ * connection.get("/").body
14
17
* ```
15
18
*/
16
19
class FaradayHttpRequest extends HTTP:: Client:: Request:: Range {
@@ -38,7 +41,8 @@ class FaradayHttpRequest extends HTTP::Client::Request::Range {
38
41
39
42
override DataFlow:: Node getURL ( ) {
40
43
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" )
42
46
}
43
47
44
48
override predicate disablesCertificateValidation ( DataFlow:: Node disablingNode ) {
Original file line number Diff line number Diff line change 29
29
resp9 . body
30
30
31
31
resp10 = 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 25
25
| 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 |
26
26
| 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 |
27
27
| 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 |
28
31
| 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 |
29
32
| 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 |
30
33
| 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