33from django .http import HttpResponse , HttpResponseRedirect , JsonResponse , HttpResponseNotFound
44from django .views import View
55import django .views .generic .base
6+ from django .views .decorators .http import require_GET
67
78
89def url_match_xss (request , foo , bar , no_taint = None ): # $requestHandler routedParameter=foo routedParameter=bar
@@ -105,6 +106,10 @@ def not_valid_identifier(request): # $requestHandler
105106 path ("not_valid/<not_valid!>" , not_valid_identifier ), # $routeSetup="not_valid/<not_valid!>"
106107]
107108
109+ ################################################################################
110+ # Deprecated django.conf.urls.url
111+ ################################################################################
112+
108113# This version 1.x way of defining urls is deprecated in Django 3.1, but still works
109114from django .conf .urls import url
110115
@@ -116,9 +121,22 @@ def deprecated(request): # $requestHandler
116121]
117122
118123
124+ ################################################################################
125+ # Special stuff
126+ ################################################################################
127+
119128class PossiblyNotRouted (View ):
120129 # Even if our analysis can't find a route-setup for this class, we should still
121130 # consider it to be a handle incoming HTTP requests
122131
123132 def get (self , request , possibly_not_routed = 42 ): # $ requestHandler routedParameter=possibly_not_routed
124133 return HttpResponse ('PossiblyNotRouted get: {}' .format (possibly_not_routed )) # $HttpResponse
134+
135+
136+ @require_GET
137+ def with_decorator (request , foo ): # $ MISSING: requestHandler routedParameter=foo
138+ pass
139+
140+ urlpatterns = [
141+ path ("with_decorator/<foo>" , with_decorator ), # $ routeSetup="with_decorator/<foo>"
142+ ]
0 commit comments