@@ -247,4 +247,42 @@ private module Twisted {
247247
248248 override string getMimetypeDefault ( ) { result = "text/html" }
249249 }
250+
251+ /**
252+ * A call to the `addCookie` function on a twisted request.
253+ *
254+ * See https://twistedmatrix.com/documents/21.2.0/api/twisted.web.http.Request.html#addCookie
255+ */
256+ class TwistedRequestAddCookieCall extends HTTP:: Server:: CookieWrite:: Range ,
257+ DataFlow:: MethodCallNode {
258+ TwistedRequestAddCookieCall ( ) { this .calls ( Twisted:: Request:: instance ( ) , "addCookie" ) }
259+
260+ override DataFlow:: Node getHeaderArg ( ) { none ( ) }
261+
262+ override DataFlow:: Node getNameArg ( ) { result in [ this .getArg ( 0 ) , this .getArgByName ( "k" ) ] }
263+
264+ override DataFlow:: Node getValueArg ( ) { result in [ this .getArg ( 1 ) , this .getArgByName ( "v" ) ] }
265+ }
266+
267+ /**
268+ * A call to `append` on the `cookies` attribute of a twisted request.
269+ *
270+ * See https://twistedmatrix.com/documents/21.2.0/api/twisted.web.http.Request.html#cookies
271+ */
272+ class TwistedRequestCookiesAppendCall extends HTTP:: Server:: CookieWrite:: Range ,
273+ DataFlow:: MethodCallNode {
274+ TwistedRequestCookiesAppendCall ( ) {
275+ exists ( DataFlow:: AttrRead cookiesLookup |
276+ cookiesLookup .getObject ( ) = Twisted:: Request:: instance ( ) and
277+ cookiesLookup .getAttributeName ( ) = "cookies" and
278+ this .calls ( cookiesLookup , "append" )
279+ )
280+ }
281+
282+ override DataFlow:: Node getHeaderArg ( ) { result = this .getArg ( 0 ) }
283+
284+ override DataFlow:: Node getNameArg ( ) { none ( ) }
285+
286+ override DataFlow:: Node getValueArg ( ) { none ( ) }
287+ }
250288}
0 commit comments