Skip to content

Commit 25d51a0

Browse files
therepanicjzheaux
authored andcommitted
Include HTTP Method in equals and hashCode
Closes gh-17180 Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
1 parent bd020d8 commit 25d51a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web/src/main/java/org/springframework/security/web/servlet/util/matcher/PathPatternRequestMatcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ public boolean equals(Object o) {
138138
if (!(o instanceof PathPatternRequestMatcher that)) {
139139
return false;
140140
}
141-
return Objects.equals(this.pattern, that.pattern);
141+
return Objects.equals(this.pattern, that.pattern) && Objects.equals(this.method, that.method);
142142
}
143143

144144
/**
145145
* {@inheritDoc}
146146
*/
147147
@Override
148148
public int hashCode() {
149-
return Objects.hash(this.pattern);
149+
return Objects.hash(this.pattern, this.method);
150150
}
151151

152152
/**

0 commit comments

Comments
 (0)