1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Use MvcRequestMatcher by default if Spring MVC is present

Closes gh-11899
This commit is contained in:
Marcus Da Coregio
2022-10-04 13:29:39 -03:00
committed by Marcus Hert Da Coregio
parent 353ca76973
commit c4d23f2b49
82 changed files with 391 additions and 177 deletions
@@ -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();