@@ -724,7 +724,8 @@ private module Django {
724724 *
725725 * Use the predicate `HttpResponseRedirect::instance()` to get references to instances of `django.http.response.HttpResponseRedirect`.
726726 */
727- abstract class InstanceSource extends HttpResponse:: InstanceSource , DataFlow:: Node { }
727+ abstract class InstanceSource extends HttpResponse:: InstanceSource ,
728+ HTTP:: Server:: HttpRedirectResponse:: Range , DataFlow:: Node { }
728729
729730 /** A direct instantiation of `django.http.response.HttpResponseRedirect`. */
730731 private class ClassInstantiation extends InstanceSource , DataFlow:: CfgNode {
@@ -739,6 +740,10 @@ private module Django {
739740 result .asCfgNode ( ) in [ node .getArg ( 1 ) , node .getArgByName ( "content" ) ]
740741 }
741742
743+ override DataFlow:: Node getRedirectLocation ( ) {
744+ result .asCfgNode ( ) in [ node .getArg ( 0 ) , node .getArgByName ( "redirect_to" ) ]
745+ }
746+
742747 // How to support the `headers` argument here?
743748 override DataFlow:: Node getMimetypeOrContentTypeArg ( ) { none ( ) }
744749
@@ -790,7 +795,8 @@ private module Django {
790795 *
791796 * Use the predicate `HttpResponsePermanentRedirect::instance()` to get references to instances of `django.http.response.HttpResponsePermanentRedirect`.
792797 */
793- abstract class InstanceSource extends HttpResponse:: InstanceSource , DataFlow:: Node { }
798+ abstract class InstanceSource extends HttpResponse:: InstanceSource ,
799+ HTTP:: Server:: HttpRedirectResponse:: Range , DataFlow:: Node { }
794800
795801 /** A direct instantiation of `django.http.response.HttpResponsePermanentRedirect`. */
796802 private class ClassInstantiation extends InstanceSource , DataFlow:: CfgNode {
@@ -805,6 +811,10 @@ private module Django {
805811 result .asCfgNode ( ) in [ node .getArg ( 1 ) , node .getArgByName ( "content" ) ]
806812 }
807813
814+ override DataFlow:: Node getRedirectLocation ( ) {
815+ result .asCfgNode ( ) in [ node .getArg ( 0 ) , node .getArgByName ( "redirect_to" ) ]
816+ }
817+
808818 // How to support the `headers` argument here?
809819 override DataFlow:: Node getMimetypeOrContentTypeArg ( ) { none ( ) }
810820
0 commit comments