Ruby: Avoid a forced CP.

This commit is contained in:
Alex Eyers-Taylor
2025-04-01 16:16:13 +01:00
parent 7096abe0a9
commit 1cf1acbbc6

View File

@@ -54,6 +54,14 @@ class NetHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode {
override DataFlow::Node getAUrlPart() {
result = request.getArgument(0)
or
result = this.getAUrlPartFromConstructor()
}
/**
* Gets a node that contributes to the URL of the request
* indirectly, through the constructor.
*/
private DataFlow::Node getAUrlPartFromConstructor() {
// Net::HTTP.new(...).get(...)
exists(API::Node new |
new = API::getTopLevelMember("Net").getMember("HTTP").getInstance() and