@@ -56,6 +56,34 @@ class ApacheHttpRequestHandlerParameter extends Parameter {
5656 }
5757}
5858
59+ /**
60+ * A call that sets a header of an `HttpResponse`.
61+ */
62+ class ApacheHttpSetHeader extends Call {
63+ ApacheHttpSetHeader ( ) {
64+ exists ( Method m |
65+ this .getCallee ( ) .( Method ) .overrides * ( m ) and
66+ m .getDeclaringType ( )
67+ .hasQualifiedName ( [ "org.apache.http" , "org.apache.hc.core5.http" ] , "HttpMessage" ) and
68+ m .hasName ( [ "addHeader" , "setHeader" ] ) and
69+ m .getNumberOfParameters ( ) = 2
70+ )
71+ or
72+ exists ( Constructor c |
73+ this .getCallee ( ) = c and
74+ c .getDeclaringType ( )
75+ .hasQualifiedName ( [ "org.apache.http.message" , "org.apache.hc.core5.http.message" ] ,
76+ "BasicHeader" )
77+ )
78+ }
79+
80+ /** Gets the expression used as the name of this header. */
81+ Expr getName ( ) { result = this .getArgument ( 0 ) }
82+
83+ /** Gets the expression used as the value of this header. */
84+ Expr getValue ( ) { result = this .getArgument ( 1 ) }
85+ }
86+
5987/**
6088 * A call that sets the entity of an instance of `org.apache.http.HttpResponse` / `org.apache.hc.core5.http.ClassicHttpResponse`.
6189 */
@@ -146,6 +174,9 @@ private class ApacheHttpGetter extends TaintPreservingCallable {
146174 or
147175 ty = "HttpEntity" and
148176 mtd = [ "getContent" , "getTrailers" ]
177+ or
178+ ty = "EntityDetails" and
179+ mtd = [ "getContentType" , "getTrailerNames" ]
149180 )
150181 or
151182 pkg = "org.apache.hc.core5.message" and
0 commit comments