Added support for del function in superagent

This commit is contained in:
Napalys
2025-03-19 17:45:20 +01:00
parent e5c179d5a4
commit 2e1734eeba
3 changed files with 12 additions and 2 deletions

View File

@@ -513,6 +513,13 @@ module ClientRequest {
}
}
/**
* Gets the name of a superagent request method.
*/
private string getSuperagentRequestMethodName() {
result = [httpMethodName(), any(Http::RequestMethodName m), "del", "DEL"]
}
/**
* A model of a URL request made using the `superagent` library.
*/
@@ -522,7 +529,7 @@ module ClientRequest {
SuperAgentUrlRequest() {
exists(string moduleName, DataFlow::SourceNode callee | this = callee.getACall() |
moduleName = "superagent" and
callee = DataFlow::moduleMember(moduleName, httpMethodName()) and
callee = DataFlow::moduleMember(moduleName, getSuperagentRequestMethodName()) and
url = this.getArgument(0)
)
}