Skip to content

Commit 0462425

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: rename getMethod to getMethodValue
1 parent 20e8eb4 commit 0462425

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class SpringRequestMappingMethod extends SpringControllerMethod {
157157
string getValue() { result = requestMappingAnnotation.getStringValue("value") }
158158

159159
/** Gets the "method" @RequestMapping annotation value, if present. */
160-
string getMethod() {
160+
string getMethodValue() {
161161
result = requestMappingAnnotation.getAnEnumConstantArrayValue("method").getName()
162162
}
163163

java/ql/lib/semmle/code/java/security/CsrfUnprotectedRequestTypeQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ private class SpringCsrfUnprotectedMethod extends CsrfUnprotectedMethod instance
2525
or
2626
this.hasAnnotation("org.springframework.web.bind.annotation", "RequestMapping") and
2727
(
28-
this.getMethod() = ["GET", "HEAD", "OPTIONS", "TRACE"]
28+
this.getMethodValue() = ["GET", "HEAD", "OPTIONS", "TRACE"]
2929
or
3030
// If no request type is specified with `@RequestMapping`, then all request types
3131
// are possible, so we treat this as unsafe; example: @RequestMapping(value = "test").
32-
not exists(this.getMethod())
32+
not exists(this.getMethodValue())
3333
)
3434
}
3535
}

0 commit comments

Comments
 (0)