Skip to content

Commit f865fa3

Browse files
committed
Python: simplify using getSubscript
1 parent 4f47461 commit f865fa3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -570,12 +570,8 @@ module AiohttpWebModel {
570570
override DataFlow::Node getMimetypeOrContentTypeArg() {
571571
result = this.getArgByName("content_type")
572572
or
573-
exists(DataFlow::Node headers, Dict d |
574-
headers = this.getArgByName("headers").getALocalSource()
575-
|
576-
headers.asExpr() = d and
577-
d.getAKey().(StrConst).getText().toLowerCase() = "content-type" and
578-
d.getAValue() = result.asExpr()
573+
exists(string key | key.toLowerCase() = "content-type" |
574+
result = this.getKeywordParameter("headers").getSubscript(key).getAValueReachingSink()
579575
)
580576
}
581577

0 commit comments

Comments
 (0)