Golang: Change HTTP ClientRequest type to DataFlow::CallNode #184
-
Could the type of ClientRequest be changed to a DataFlow::CallNode? In the javascript version of CodeQL the type is an InvokeNode, which allows for
In the golang version, I had to do
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm not sure. I think keeping the more general type has its advantage, just in case we end up wanting to model an API where the client request isn't actually a call. Note that you can use postfix casts to suppress most of the syntactic noise: exists(HTTP::ClientRequest req | sink = req.(DataFlow::CallNode).getAnArgument()) Longer term, I think it would be worth considering introducing a member predicate on |
Beta Was this translation helpful? Give feedback.
I'm not sure. I think keeping the more general type has its advantage, just in case we end up wanting to model an API where the client request isn't actually a call. Note that you can use postfix casts to suppress most of the syntactic noise:
Longer term, I think it would be worth considering introducing a member predicate on
HTTP::ClientRequest
that does what you are usinggetAnArgument()
for here, though I'm not entirely sure what that is.