mirror of
https://github.com/spring-projects/spring-security.git
synced 2026-01-17 03:46:56 +00:00
docs: Typo in page Preparing for 7.0 / Web (version 6.5)
In section 'Include the Servlet Path Prefix in Authorization Rules', `PathPatternRequestParser` should be replaced by `PathPatternRequestMatcher`. Signed-off-by: Guillaume Husta <guillaume.husta@gmail.com>
This commit is contained in:
parent
7ea5be4b98
commit
508b3f26e3
@ -414,22 +414,22 @@ Instead of taking this responsibility away from developers, now it is simpler to
|
||||
|
||||
[method,java]
|
||||
----
|
||||
PathPatternRequestParser.Builder servlet = PathPatternRequestParser.withDefaults().basePath("/mvc");
|
||||
PathPatternRequestMatcher.Builder servlet = PathPatternRequestMatcher.withDefaults().basePath("/mvc");
|
||||
http
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.requestMatchers(servlet.pattern("/orders/**").matcher()).authenticated()
|
||||
.requestMatchers(servlet.matcher("/orders/**")).authenticated()
|
||||
)
|
||||
----
|
||||
|
||||
|
||||
For paths that belong to the default servlet, use `PathPatternRequestParser.withDefaults()` instead:
|
||||
For paths that belong to the default servlet, use `PathPatternRequestMatcher.withDefaults()` instead:
|
||||
|
||||
[method,java]
|
||||
----
|
||||
PathPatternRequestParser.Builder request = PathPatternRequestParser.withDefaults();
|
||||
PathPatternRequestMatcher.Builder request = PathPatternRequestMatcher.withDefaults();
|
||||
http
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.requestMatchers(request.pattern("/js/**").matcher()).authenticated()
|
||||
.requestMatchers(request.matcher("/js/**")).authenticated()
|
||||
)
|
||||
----
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user