File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
javascript/ql/lib/semmle/javascript/security/dataflow Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -29,12 +29,12 @@ module ReflectedXss {
29
29
}
30
30
31
31
/**
32
- * DEPRECATED: Gets a HeaderDefinition that defines a XSS safe content-type for `send`.
32
+ * DEPRECATED: Gets a HeaderDefinition that defines a non-html safe content-type for `send`.
33
33
*/
34
34
deprecated Http:: HeaderDefinition getANonHtmlHeaderDefinition ( Http:: ResponseSendArgument send ) {
35
35
exists ( Http:: RouteHandler h |
36
36
send .getRouteHandler ( ) = h and
37
- result = xssSafeContentTypeHeader ( h )
37
+ result = nonHtmlContentTypeHeader ( h )
38
38
|
39
39
// The HeaderDefinition affects a response sent at `send`.
40
40
headerAffects ( result , send )
@@ -72,9 +72,7 @@ module ReflectedXss {
72
72
*/
73
73
deprecated Http:: HeaderDefinition nonHtmlContentTypeHeader ( Http:: RouteHandler h ) {
74
74
result = h .getAResponseHeader ( "content-type" ) and
75
- not exists ( string tp | result .defines ( "content-type" , tp ) |
76
- tp .toLowerCase ( ) .matches ( xssUnsafeContentType ( ) + "%" )
77
- )
75
+ not exists ( string tp | result .defines ( "content-type" , tp ) | tp .regexpMatch ( "(?i).*html.*" ) )
78
76
}
79
77
80
78
/**
You can’t perform that action at this time.
0 commit comments