mirror of
https://github.com/github/codeql.git
synced 2026-01-30 06:42:57 +01:00
Model HTTP request functions in net/http package.
This commit is contained in:
@@ -147,4 +147,21 @@ private module StdlibHttp {
|
||||
|
||||
override HTTP::ResponseWriter getResponseWriter() { result.getANode() = this.getArgument(0) }
|
||||
}
|
||||
|
||||
/** A call to a function in the `net/http` package that performs an HTTP request to a URL. */
|
||||
private class RequestCall extends HTTP::ClientRequest::Range, DataFlow::CallNode {
|
||||
RequestCall() {
|
||||
exists(string functionName |
|
||||
(
|
||||
this.getTarget().hasQualifiedName("net/http", functionName)
|
||||
or
|
||||
this.getTarget().(Method).hasQualifiedName("net/http", "Client", functionName)
|
||||
) and
|
||||
(functionName = "Get" or functionName = "Post" or functionName = "PostForm")
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets the URL of the request. */
|
||||
override DataFlow::Node getUrl() { result = this.getArgument(0) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user