Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb1efa9

Browse files
tausbnRasmusWL
authored andcommitted
Python: Add Flask response model
1 parent 7b1c6b0 commit cb1efa9

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

python/ql/lib/semmle/python/frameworks/Flask.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ module Flask {
111111
result = API::moduleImport("flask").getMember("Response")
112112
or
113113
result = [FlaskApp::classRef(), FlaskApp::instance()].getMember("response_class")
114+
or
115+
result = ModelOutput::getATypeNode("flask.Response~Subclass").getASubclass*()
114116
}
115117

116118
/**

python/ql/src/meta/ClassHierarchy/Find.ql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ class DjangoHttpResponseFileResponse extends FindSubclassesSpec {
208208
}
209209
}
210210

211+
class FlaskResponse extends FindSubclassesSpec {
212+
FlaskResponse() { this = "flask.Response~Subclass" }
213+
214+
override API::Node getAlreadyModeledClass() { result = Flask::Response::classRef() }
215+
}
216+
211217
bindingset[fullyQualified]
212218
predicate fullyQualifiedToYamlFormat(string fullyQualified, string type2, string path) {
213219
exists(int firstDot | firstDot = fullyQualified.indexOf(".", 0, 0) |

0 commit comments

Comments
 (0)