mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-23 20:42:14 +00:00
Use PathPatternRequestMatcher in Docs
Update documenation references from PathPatternRequestMatcher to AntPathRequestMatcher Issue gh-16632
This commit is contained in:
parent
ff52e05b24
commit
59f08e861e
@ -3706,8 +3706,8 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||||||
* {@link #securityMatcher(String...)}, {@link #securityMatchers(Customizer)} and
|
* {@link #securityMatcher(String...)}, {@link #securityMatchers(Customizer)} and
|
||||||
* {@link #securityMatchers()}
|
* {@link #securityMatchers()}
|
||||||
* </p>
|
* </p>
|
||||||
* @param requestMatcher the {@link RequestMatcher} to use (i.e. new
|
* @param requestMatcher the {@link RequestMatcher} to use, for example,
|
||||||
* AntPathRequestMatcher("/admin/**","GET") )
|
* {@code PathPatternRequestMatcher.withDefaults().matcher(HttpMethod.GET, "/admin/**")}
|
||||||
* @return the {@link HttpSecurity} for further customizations
|
* @return the {@link HttpSecurity} for further customizations
|
||||||
* @see #securityMatcher(String...)
|
* @see #securityMatcher(String...)
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -145,7 +145,7 @@ public final class LogoutConfigurer<H extends HttpSecurityBuilder<H>>
|
|||||||
* (i.e. log out) to protect against
|
* (i.e. log out) to protect against
|
||||||
* <a href="https://en.wikipedia.org/wiki/Cross-site_request_forgery">CSRF
|
* <a href="https://en.wikipedia.org/wiki/Cross-site_request_forgery">CSRF
|
||||||
* attacks</a>. If you really want to use an HTTP GET, you can use
|
* attacks</a>. If you really want to use an HTTP GET, you can use
|
||||||
* <code>logoutRequestMatcher(new AntPathRequestMatcher(logoutUrl, "GET"));</code>
|
* <code>logoutRequestMatcher(PathPatternRequestMatcher.withDefaults().matcher(HttpMethod.GEt, logoutUrl));</code>
|
||||||
* </p>
|
* </p>
|
||||||
* @param logoutUrl the URL that will invoke logout.
|
* @param logoutUrl the URL that will invoke logout.
|
||||||
* @return the {@link LogoutConfigurer} for further customization
|
* @return the {@link LogoutConfigurer} for further customization
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -192,7 +192,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
|||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* securityMatcher(AntPathRequestMatcher("/private/**"))
|
* securityMatcher(PathPatternRequestMatcher.withDefaults().matcher("/private/**"))
|
||||||
* formLogin {
|
* formLogin {
|
||||||
* loginPage = "/log-in"
|
* loginPage = "/log-in"
|
||||||
* }
|
* }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user