728x90
....
어제까지만해도 잘됐던 multipartfile로 이미지업로드가 security 넣고나서 갑자기 안된다.
값이 다 안들와지는건가 로그를 찍어보니
다른거는 잘 나오는데 사진만 null이다.
좀 검색해보니 form에 action url에
?${_csrf.parameterName}=${_csrf.token}
이걸 붙이라고 나온다.
즉 이런모양
근데....
....?
이런식으로 붙이는 게 아닌가.? 보다.
이렇게 해도 안됨.
더 검색해보니 다들 csrf토큰 사용하려면 web.xml에 필터를 추가하래
아니 springboot 플젝이라서 web.xml없다고
그냥 만들어서 해야하나...
이렇게 불편하게 해놨을리가 없는데..
근데 편한방법 못찾음.
결국 사방팔방 돌아다니다 xml의 filter를 자바코드로 빈으로 등록하는 법을 찾게되고...(그런 방법이 존재하는지도 몰랐음..ㅋㅋㅋ)
https://stackoverflow.com/questions/19825946/how-can-i-add-a-filter-class-in-spring-boot/30658752#30658752
https://goldswan.tistory.com/43
필터를 등록해주니 csrf토큰도 없어도 된다.
아니 원래 필터가 필요했던건가?
아니지 시큐리티 없었을땐 잘됐어..
뭘까
728x90
'with my rubber duck > errors' 카테고리의 다른 글
Oracle invalid datatype error when add constraints (0) | 2022.06.22 |
---|---|
스프링에서 로그찍기 log4j xml 에러, 로그 안찍힘 해결 (0) | 2022.06.17 |
WebSecurityConfig에서 BeanCurrentlyInCreationException (0) | 2022.06.14 |
intellij 콘솔 한글깨짐 문제해결 여정(부제: 재실행의 중요성) (0) | 2022.05.26 |
intellij spring boot 포트번호 바꾸는 3가지 방법 (0) | 2022.05.26 |
댓글