pooney

Spring security 적용시 기본적으로 csrf를 막기위하여 활성화 되어 있다 때문에 csrf 체크를 하여 @GetMapping 호출 시 문제가 없지만@PostMapping 호출 시 404에러 발생한다. 이것을 해결 하기 위해서는 Security 설정 파일에서 csrf().disable()를 삽입하면 해결 가능하다.

 

 @Override
    protected void configure(HttpSecurity http) throws Exception {
        log.info("아래 코드 삽입");
 		http.csrf().disable();
 }

 

profile

pooney

@pooney

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!