File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
lib/semmle/python/frameworks
test/library-tests/frameworks/flask Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -178,11 +178,9 @@ module Flask {
178
178
* - https://flask.palletsprojects.com/en/2.2.x/api/#flask.json.jsonify
179
179
*/
180
180
private class FlaskJsonifyCall extends InstanceSource , DataFlow:: CallCfgNode {
181
- FlaskJsonifyCall ( ) {
182
- this = API:: moduleImport ( "flask" ) .getMember ( "jsonify" ) .getACall ( )
183
- }
181
+ FlaskJsonifyCall ( ) { this = API:: moduleImport ( "flask" ) .getMember ( "jsonify" ) .getACall ( ) }
184
182
185
- override DataFlow:: Node getBody ( ) { result = this .getArg ( 0 ) }
183
+ override DataFlow:: Node getBody ( ) { result in [ this .getArg ( _ ) , this . getArgByName ( _ ) ] }
186
184
187
185
override string getMimetypeDefault ( ) { result = "application/json" }
188
186
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ def html8(): # $requestHandler
66
66
67
67
@app .route ("/jsonify" ) # $routeSetup="/jsonify"
68
68
def jsonify_route (): # $requestHandler
69
- data = { "foo" : "bar" }
70
- resp = jsonify (data ) # $ HttpResponse mimetype=application/json responseBody=data
69
+ x = "x" ; y = "y" ; z = "z"
70
+ resp = jsonify (x , y , z = z ) # $ HttpResponse mimetype=application/json responseBody=x responseBody=y responseBody=z
71
71
return resp # $ SPURIOUS: HttpResponse mimetype=text/html responseBody=resp
72
72
73
73
################################################################################
You can’t perform that action at this time.
0 commit comments