We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3fd2c7d commit 9ea8b34Copy full SHA for 9ea8b34
ql/src/semmle/go/concepts/HTTP.qll
@@ -190,7 +190,14 @@ module HTTP {
190
abstract ResponseWriter getResponseWriter();
191
192
/** Gets a content-type associated with this body. */
193
- string getAContentType() { result = getAContentTypeNode().getStringValue() }
+ string getAContentType() {
194
+ exists(HTTP::HeaderWrite hw | hw = getResponseWriter().getAHeaderWrite() |
195
+ hw.getHeaderName() = "content-type" and
196
+ result = hw.getHeaderValue()
197
+ )
198
+ or
199
+ result = getAContentTypeNode().getStringValue()
200
+ }
201
202
/** Gets a dataflow node for a content-type associated with this body. */
203
DataFlow::Node getAContentTypeNode() {
0 commit comments