Class WebBrowserUserAgentRequestMatcher
java.lang.Object
org.pentaho.platform.web.servlet.matchers.WebBrowserUserAgentRequestMatcher
- All Implemented Interfaces:
org.springframework.security.web.util.matcher.RequestMatcher
public class WebBrowserUserAgentRequestMatcher
extends Object
implements org.springframework.security.web.util.matcher.RequestMatcher
The
WebBrowserUserAgentRequestMatcher determines if a request is made by a web browser based on the
presence and value of the `User-Agent` HTTP request header.
The matcher does not distinguish whether the request is a user navigation request or not. The only criterion is
whether the request is made by a web browser. To test if a request is a user navigation request, the corresponding
weak matcher, UserNavigationAcceptRequestMatcher can be used.
This matcher immediately returns `false` if the `sec-fetch-dest` is present in the request, as in that case, the "weaker" logic should not be used. Instead, this matcher should be combined
In Pentaho, this matcher is used to select an appropriate authentication failure response, depending on whether the request is made by a web browser or a tool.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.security.web.util.matcher.RequestMatcher
org.springframework.security.web.util.matcher.RequestMatcher.MatchResult -
Constructor Summary
ConstructorsConstructorDescriptionWebBrowserUserAgentRequestMatcher(List<String> browserPatterns, List<String> nonBrowserPatterns) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.web.util.matcher.RequestMatcher
matcher
-
Constructor Details
-
WebBrowserUserAgentRequestMatcher
public WebBrowserUserAgentRequestMatcher() -
WebBrowserUserAgentRequestMatcher
-
-
Method Details
-
isBrowser
-
matches
public boolean matches(@NonNull jakarta.servlet.http.HttpServletRequest request) - Specified by:
matchesin interfaceorg.springframework.security.web.util.matcher.RequestMatcher
-