mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Csharp: rename predicate
This commit is contained in:
@@ -16,12 +16,12 @@ import csharp
|
||||
import semmle.code.asp.WebConfig
|
||||
import semmle.code.csharp.frameworks.system.Web
|
||||
|
||||
XmlElement getAWebServerConfig(WebConfigXml webConfig) {
|
||||
XmlElement getAWebConfigRoot(WebConfigXml webConfig) {
|
||||
result = webConfig.getARootElement()
|
||||
or
|
||||
result = webConfig.getARootElement().getAChild("location") and
|
||||
(
|
||||
not exists(result.getAttributeValue("path")) // equivalent to path="."
|
||||
not result.hasAttribute("path") // equivalent to path="."
|
||||
or
|
||||
result.getAttributeValue("path") = ["", "."]
|
||||
)
|
||||
@@ -42,7 +42,7 @@ predicate hasWebConfigXFrameOptions(WebConfigXml webConfig) {
|
||||
// </system.webServer>
|
||||
// ```
|
||||
// This can also be in a `location`
|
||||
getAWebServerConfig(webConfig)
|
||||
getAWebConfigRoot(webConfig)
|
||||
.getAChild("system.webServer")
|
||||
.getAChild("httpProtocol")
|
||||
.getAChild("customHeaders")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
---
|
||||
category: minorAnalysis
|
||||
---
|
||||
* the `cs/web/missing-x-frame-options` query now correctly handles configuration nested in `<location>` elements.
|
||||
* the `cs/web/missing-x-frame-options` query now correctly handles configuration nested in a `<location >` elements.
|
||||
|
||||
Reference in New Issue
Block a user