Skip to content

Commit a0201e9

Browse files
Update tests for new cookie write from headers
1 parent 6b8080a commit a0201e9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

python/ql/lib/semmle/python/Concepts.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,9 +1246,7 @@ module Http {
12461246
)
12471247
}
12481248

1249-
override DataFlow::Node getNameArg() {
1250-
result = this.(Http::Server::ResponseHeaderWrite).getValueArg()
1251-
}
1249+
override DataFlow::Node getNameArg() { none() }
12521250

12531251
override DataFlow::Node getHeaderArg() {
12541252
result = this.(Http::Server::ResponseHeaderWrite).getValueArg()

python/ql/test/library-tests/frameworks/flask/response_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def setting_cookie(): # $requestHandler
208208
resp = make_response() # $ HttpResponse mimetype=text/html
209209
resp.set_cookie("key", "value") # $ CookieWrite CookieName="key" CookieValue="value"
210210
resp.set_cookie(key="key", value="value") # $ CookieWrite CookieName="key" CookieValue="value"
211-
resp.headers.add("Set-Cookie", "key2=value2") # $ headerWriteNameUnsanitized="Set-Cookie" headerWriteValue="key2=value2" MISSING: CookieWrite CookieRawHeader="key2=value2"
211+
resp.headers.add("Set-Cookie", "key2=value2") # $ headerWriteNameUnsanitized="Set-Cookie" headerWriteValue="key2=value2" CookieWrite CookieRawHeader="key2=value2"
212212
resp.delete_cookie("key3") # $ CookieWrite CookieName="key3"
213213
resp.delete_cookie(key="key3") # $ CookieWrite CookieName="key3"
214214
return resp # $ SPURIOUS: HttpResponse mimetype=text/html responseBody=resp

0 commit comments

Comments
 (0)