REST API 개발을 진행하던 도중..
403이든 404든.. 어떤 bad request에서도 response body가 텅텅 비어있었다.
application.properties 를 만져도 안되고..ㅠㅠ
남들은 기본으로 받는 에러 응답이라던데 왜 나는 안나와!? ㅠㅠ
https://github.com/spring-projects/spring-boot/issues/28953
ResponseStatusException no longer returning response body in 2.6.1 using spring security · Issue #28953 · spring-projects/spri
we found that after upgrading to spring boot 2.6.1 that the response body from the ResponseStatusException is no longer being populated even for authenticated users It looks like the spring boot fo...
github.com
위의 타래에서 해결 됨.
SpringBoot 2.6.1을 쓰고 있었고 정확히 나와 같은 증상이었다.
해결방법
Spring Security에서 권한 없이 접근가능한 페이지에 "/error"를 추가하는 것..

4시간을 헤맸다 이것 때문에 (억울!)

잘 나온다..!!! ㅠㅠ
'2021 웹개발 101' 카테고리의 다른 글
[spring boot] 백엔드 어플리케이션을 AWS의 elastic beanstalk으로 배포 (0) | 2021.12.29 |
---|---|
[Spring boot] REST API 예제 완성 후기.. (0) | 2021.12.27 |
[Spring Boot] REST API 예제: 1. CRUD 구현 (0) | 2021.12.07 |
[Spring Boot] Postman 으로 요청과 응답 확인 (0) | 2021.12.07 |
[Spring Boot] 레이어드 아키텍처, REST API (0) | 2021.12.07 |