mirror of
https://github.com/github/codeql.git
synced 2026-04-17 21:14:02 +02:00
Java: rename getMethod to getMethodValue
This commit is contained in:
@@ -157,7 +157,7 @@ class SpringRequestMappingMethod extends SpringControllerMethod {
|
||||
string getValue() { result = requestMappingAnnotation.getStringValue("value") }
|
||||
|
||||
/** Gets the "method" @RequestMapping annotation value, if present. */
|
||||
string getMethod() {
|
||||
string getMethodValue() {
|
||||
result = requestMappingAnnotation.getAnEnumConstantArrayValue("method").getName()
|
||||
}
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@ private class SpringCsrfUnprotectedMethod extends CsrfUnprotectedMethod instance
|
||||
or
|
||||
this.hasAnnotation("org.springframework.web.bind.annotation", "RequestMapping") and
|
||||
(
|
||||
this.getMethod() = ["GET", "HEAD", "OPTIONS", "TRACE"]
|
||||
this.getMethodValue() = ["GET", "HEAD", "OPTIONS", "TRACE"]
|
||||
or
|
||||
// If no request type is specified with `@RequestMapping`, then all request types
|
||||
// are possible, so we treat this as unsafe; example: @RequestMapping(value = "test").
|
||||
not exists(this.getMethod())
|
||||
not exists(this.getMethodValue())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user