Update python/ql/src/semmle/python/frameworks/Django.qll

Co-authored-by: Rasmus Wriedt Larsen <rasmuswl@github.com>
This commit is contained in:
yoff
2021-02-05 23:31:20 +01:00
committed by GitHub
parent 93f91d8746
commit ddd362bc16

View File

@@ -2314,6 +2314,13 @@ private module Django {
DjangoShortcutsRedirectCall() { node.getFunction() = django::shortcuts::redirect().asCfgNode() }
/**
* Gets the data-flow node that specifies the location of this HTTP redirect response.
*
* Note: For `django.shortcuts.redirect`, the result might not be a full URL
* (as usually expected by this method), but could be a relative URL,
* a string identifying a view, or a Django model.
*/
override DataFlow::Node getRedirectLocation() {
result.asCfgNode() in [node.getArg(0), node.getArgByName("to")]
}