Skip to content

Commit f84331f

Browse files
Provides classes for modeling HTTP Header APIs
1 parent 94b9153 commit f84331f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

python/ql/src/experimental/semmle/python/Concepts.qll

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,39 @@ class HeaderDeclaration extends DataFlow::Node {
371371
DataFlow::Node getValueArg() { result = range.getValueArg() }
372372
}
373373

374+
/** Provides classes for modeling HTTP Header APIs. */
375+
module HeaderCollection {
376+
/**
377+
* A data-flow node that collects functions getting HTTP Headers.
378+
*
379+
* Extend this class to model new APIs. If you want to refine existing API models,
380+
* extend `HeaderCollection` instead.
381+
*/
382+
abstract class Range extends DataFlow::Node {
383+
/**
384+
* Gets the argument containing the header name.
385+
*/
386+
abstract DataFlow::Node getNameArg();
387+
}
388+
}
389+
390+
/**
391+
* A data-flow node that collects functions getting HTTP Headers.
392+
*
393+
* Extend this class to refine existing API models. If you want to model new APIs,
394+
* extend `HeaderCollection::Range` instead.
395+
*/
396+
class HeaderCollection extends DataFlow::Node {
397+
HeaderCollection::Range range;
398+
399+
HeaderCollection() { this = range }
400+
401+
/**
402+
* Gets the argument containing the header name.
403+
*/
404+
DataFlow::Node getNameArg() { result = range.getNameArg() }
405+
}
406+
374407
/** Provides classes for modeling Csv writer APIs. */
375408
module CsvWriter {
376409
/**

0 commit comments

Comments
 (0)