File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
python/ql/test/library-tests/frameworks/fastapi Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,17 @@ async def form_example(username: str = Form(None)): # $ requestHandler routedPar
73
73
return "ok" # $ HttpResponse
74
74
75
75
76
+ # --- HTTP headers ---
77
+ # see https://fastapi.tiangolo.com/tutorial/header-params/
78
+
79
+ from fastapi import Header
80
+
81
+ @app .get ("/header-example" ) # $ routeSetup="/header-example"
82
+ async def header_example (user_agent : Optional [str ] = Header (None )): # $ requestHandler routedParameter=user_agent
83
+ ensure_tainted (user_agent ) # $ tainted
84
+ return "ok" # $ HttpResponse
85
+
86
+
76
87
# --- file upload ---
77
88
# see https://fastapi.tiangolo.com/tutorial/request-files/
78
89
# see https://fastapi.tiangolo.com/tutorial/request-files/#uploadfile
You can’t perform that action at this time.
0 commit comments