Skip to content

Commit 1aa222d

Browse files
committed
Python: Add taint-test for class-based view
1 parent fb21bc0 commit 1aa222d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

python/ql/test/library-tests/frameworks/aiohttp/taint_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,16 @@ async def test_taint(request: web.Request): # $ requestHandler
193193
)
194194

195195

196+
class TaintTestClass(web.View):
197+
def get(self):
198+
ensure_tainted(
199+
self.request, # $ MISSING: tainted
200+
)
201+
202+
196203
app = web.Application()
197204
app.router.add_get(r"/test_taint/{name}/{number:\d+}", test_taint) # $ routeSetup="/test_taint/{name}/{number:\d+}"
205+
app.router.add_view(r"/test_taint_class", TaintTestClass) # $ routeSetup="/test_taint_class"
198206

199207

200208
if __name__ == "__main__":

0 commit comments

Comments
 (0)