Use MvcRequestMatcher by default if Spring MVC is present
Closes gh-11899
This commit is contained in:
committed by
Marcus Hert Da Coregio
parent
353ca76973
commit
c4d23f2b49
+20
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.security.web.servlet.util.matcher;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -129,6 +130,24 @@ public class MvcRequestMatcher implements RequestMatcher, RequestVariablesExtrac
|
||||
return this.servletPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
MvcRequestMatcher that = (MvcRequestMatcher) o;
|
||||
return Objects.equals(this.pattern, that.pattern) && Objects.equals(this.method, that.method)
|
||||
&& Objects.equals(this.servletPath, that.servletPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(this.pattern, this.method, this.servletPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user