Skip to content

Set the useTrailingSlashMatch to true for tests #11462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ static class LegacyMvcMatchingConfig implements WebMvcConfigurer {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(true);
configurer.setUseTrailingSlashMatch(true);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ static class LegacyMvcMatchingConfig implements WebMvcConfigurer {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(true);
configurer.setUseTrailingSlashMatch(true);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ static class LegacyMvcMatchingConfig implements WebMvcConfigurer {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(true);
configurer.setUseTrailingSlashMatch(true);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ static class LegacyMvcMatchingConfig implements WebMvcConfigurer {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(true);
configurer.setUseTrailingSlashMatch(true);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void cookies() {
class HelloWorldController {

@ResponseBody
@GetMapping(produces = MediaType.TEXT_HTML_VALUE)
@GetMapping(path = "/", produces = MediaType.TEXT_HTML_VALUE)
String index() {
// @formatter:off
return "<html>\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class AuthorizeHttpRequestsDslTests {
open class LegacyMvcMatchingConfig : WebMvcConfigurer {
override fun configurePathMatch(configurer: PathMatchConfigurer) {
configurer.setUseSuffixPatternMatch(true)
configurer.setUseTrailingSlashMatch(true)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ class AuthorizeRequestsDslTests {
open class LegacyMvcMatchingConfig : WebMvcConfigurer {
override fun configurePathMatch(configurer: PathMatchConfigurer) {
configurer.setUseSuffixPatternMatch(true)
configurer.setUseTrailingSlashMatch(true)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class ServerJwtDslTests {

@RestController
internal class BaseController {
@GetMapping
@GetMapping("/")
fun index() {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</http>

<mvc:annotation-driven>
<mvc:path-matching suffix-pattern="true"/>
<mvc:path-matching suffix-pattern="true" trailing-slash="true"/>
</mvc:annotation-driven>

<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</http>

<mvc:annotation-driven>
<mvc:path-matching suffix-pattern="true"/>
<mvc:path-matching suffix-pattern="true" trailing-slash="true"/>
</mvc:annotation-driven>

<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
@RestController
static class Controller {

@RequestMapping
@RequestMapping("/")
String hello() {
return "Hello";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
@RestController
static class Controller {

@RequestMapping
@RequestMapping("/")
String hello() {
return "Hello";
}
Expand Down