Golang: Change HTTP ClientRequest type to DataFlow::CallNode #184
Answered
by
max-schaefer
jason-invision
asked this question in
General
|
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 |
Answered by
max-schaefer
Sep 22, 2020
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 |
0 replies
Answer selected by
jason-invision
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to 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:
Longer term, I think it would be worth considering introducing a member predicate on
HTTP::ClientRequestthat does what you are usinggetAnArgument()for here, though I'm not entirely sure what that is.