HTTP ResponseBody: support HeaderWrites with hard-coded header values.

This commit is contained in:
Chris Smowton
2021-04-16 15:19:06 +01:00
parent 3fd2c7d4bb
commit 9ea8b34e47

View File

@@ -190,7 +190,14 @@ module HTTP {
abstract ResponseWriter getResponseWriter();
/** Gets a content-type associated with this body. */
string getAContentType() { result = getAContentTypeNode().getStringValue() }
string getAContentType() {
exists(HTTP::HeaderWrite hw | hw = getResponseWriter().getAHeaderWrite() |
hw.getHeaderName() = "content-type" and
result = hw.getHeaderValue()
)
or
result = getAContentTypeNode().getStringValue()
}
/** Gets a dataflow node for a content-type associated with this body. */
DataFlow::Node getAContentTypeNode() {