@@ -33,18 +33,17 @@ class NetHttpRequest extends Http::Client::Request::Range instanceof DataFlow::C
3333 NetHttpRequest ( ) {
3434 exists ( string method |
3535 request = requestNode .asSource ( ) and
36- this = request
36+ this = request and
37+ requestNode = connectionNode .getReturn ( method )
3738 |
3839 // Net::HTTP.get(...)
3940 method in [ "get" , "get_response" ] and
4041 connectionNode = API:: getTopLevelMember ( "Net" ) .getMember ( "HTTP" ) and
41- requestNode = connectionNode .getReturn ( method ) and
4242 returnsResponseBody = true
4343 or
4444 // Net::HTTP.post(...).body
4545 method in [ "post" , "post_form" ] and
4646 connectionNode = API:: getTopLevelMember ( "Net" ) .getMember ( "HTTP" ) and
47- requestNode = connectionNode .getReturn ( method ) and
4847 returnsResponseBody = false
4948 or
5049 // Net::HTTP.new(..).get(..).body
@@ -53,11 +52,15 @@ class NetHttpRequest extends Http::Client::Request::Range instanceof DataFlow::C
5352 "get" , "get2" , "request_get" , "head" , "head2" , "request_head" , "delete" , "put" , "patch" ,
5453 "post" , "post2" , "request_post" , "request"
5554 ] and
56- connectionNode = [
57- API:: getTopLevelMember ( "Net" ) .getMember ( "HTTP" ) .getInstance ( ) ,
58- API:: getTopLevelMember ( "Net" ) .getMember ( "HTTP" ) .getMethod ( "start" ) .getBlock ( ) .getParameter ( 0 )
55+ connectionNode =
56+ [
57+ API:: getTopLevelMember ( "Net" ) .getMember ( "HTTP" ) .getInstance ( ) ,
58+ API:: getTopLevelMember ( "Net" )
59+ .getMember ( "HTTP" )
60+ .getMethod ( "start" )
61+ .getBlock ( )
62+ .getParameter ( 0 )
5963 ] and
60- requestNode = connectionNode .getReturn ( method ) and
6164 returnsResponseBody = false
6265 )
6366 }
0 commit comments