Это мой контроллер:
Код: Выделить всё
@RestController
@RequestMapping("")
public class ProfileController {
@ResponseBody
@GetMapping(value = "/profile/{id}")
public Profileì getProfile(@PathVariable Long id){
//code
}
@ResponseBody
@PostMapping(value = "/profile")
public Profile insertProfile(@RequestBody Profile request) {
//code
}
Код: Выделить всё
@Configuration
@EnableWebSecurity
@EnableMethodSecurity(securedEnabled = true, jsr250Enabled = true)
public class SecurityAdapter {
@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
return web -> web.ignoring()
.requestMatchers(HttpMethod.GET, "/**");
}
@Bean
protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
Filter authFilter = new CustomFilter();
http
.cors(AbstractHttpConfigurer::disable)
.csrf(AbstractHttpConfigurer::disable)
.exceptionHandling(e -> e.authenticationEntryPoint(accessDeniedHandler()))
.addFilterBefore(authFilter, BasicAuthenticationFilter.class)
.authorizeHttpRequests(a -> a.requestMatchers("**").authenticated());
return http.build();
}
когда я вызываю /profile/ в POST, это выдает исключение PatternParseException.
Код: Выделить всё
org.springframework.web.util.pattern.PatternParseException: No more pattern data allowed after {*...} or ** pattern element
Большое спасибо
Подробнее здесь: https://stackoverflow.com/questions/783 ... ta-allowed