Текущая конфигурация безопасности (на Java) для конечных точек позволяет вызывать /some/ конечная точка, но не /some/endpoint/.
Я искал здесь и в документации, но не нашел ничего похожего на переключатель, позволяющий игнорировать конечные пробелы. Например, с помощью Spring MVC я могу сделать следующее:
Код: Выделить всё
@Configuration
public class ServletConfig extends WebMvcConfigurerAdapter {
@Override
public void configurePathMatch(final PathMatchConfigurer configurer) {
configurer.setUseTrailingSlashMatch(false);
}
}
Код: Выделить всё
@Bean
public ResourceServerConfigurer resourceServerConfigurer(final ScopesProperties oauthProperties) {
return new ResourceServerConfigurerAdapter() {
@Override
public void configure(final HttpSecurity http) throws Exception {
http.sessionManagement().sessionCreationPolicy(NEVER).and()
.authorizeRequests()
.antMatchers(GET, "/foo")
.access(oauthProperties.getFooRead())
.antMatchers(GET, "/bar/*")
.access(oauthProperties.getBarRead())
.antMatchers(PUT, "/bar/*")
.access(oauthProperties.getBarWrite())
// everything else
.anyRequest().denyAll();
}
Итак, вопрос в следующем: как указать Spring Security глобально игнорировать конечные косые черты?
Подробнее здесь: https://stackoverflow.com/questions/382 ... ng-slashes