File tree Expand file tree Collapse file tree
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -267,17 +267,7 @@ module ClientRequest {
267267 DataFlow:: Node url ;
268268
269269 FetchUrlRequest ( ) {
270- exists ( string moduleName , DataFlow:: SourceNode callee | this = callee .getACall ( ) |
271- (
272- moduleName = "node-fetch" or
273- moduleName = "cross-fetch" or
274- moduleName = "isomorphic-fetch"
275- ) and
276- callee = DataFlow:: moduleImport ( moduleName ) and
277- url = getArgument ( 0 )
278- )
279- or
280- this = DataFlow:: globalVarRef ( "fetch" ) .getACall ( ) and
270+ this = NodeJSLib:: Fetch:: moduleImport ( ) and
281271 url = getArgument ( 0 )
282272 }
283273
Original file line number Diff line number Diff line change @@ -1134,4 +1134,18 @@ module NodeJSLib {
11341134 result = moduleImport ( ) .getAPropertyRead ( member )
11351135 }
11361136 }
1137+
1138+ /**
1139+ * Provides predicates for working with the "node-fetch" module and its platform-specific instances as a single module.
1140+ */
1141+ module Fetch {
1142+ /**
1143+ * Gets a node that imports the "node-fetch" module, or one of its platform-specific instances.
1144+ */
1145+ DataFlow:: SourceNode moduleImport ( ) {
1146+ result = DataFlow:: moduleImport ( [ "node-fetch" , "cross-fetch" , "isomorphic-fetch" ] )
1147+ or
1148+ result = DataFlow:: globalVarRef ( "fetch" )
1149+ }
1150+ }
11371151}
You can’t perform that action at this time.
0 commit comments