Error

CORS Error : The request client is not a secure context and the resource is in more-private address space 'private' 에러 해결

Kei Song 2021. 11. 22. 18:03

안녕하세요.

오늘은 CORS Error 유형 중 하나인 (CORS Error : The request client is not a secure context and the resource is in more-private address space 'private') 에러의 발생 원인과 해결 방법에 대해 알아보도록 하겠습니다.

원인

대부분 API를 호출하다 위 에러를 마주하셨을텐데요.

이 에러는 RFC1918 표준에 따라 공용 네트워크가 개인 네트워크의 리소스를 요청하지 못하게하여 발생하는 것입니다.

자세한 내용을 원하시는 분은 아래 링크의 글을 읽어보시길 바랍니다.

 

https://stackoverflow.com/questions/66534759/chrome-cors-error-on-request-to-localhost-dev-server-from-remote-site

 

Chrome CORS error on request to localhost dev server from remote site

On Friday I had a working dev environment. On Monday I had a broken one. I encountered this error message in the Chrome dev-tools console for all my assets: Access to CSS stylesheet at 'http://loc...

stackoverflow.com

 

해결 방법

에러를 해결하기 위해서는 chrome 설정을 바꾸어야 합니다.

URL(chrome://flags/#block-insecure-private-network-requests)에 접속하여 아래와 같이 Block insecure private network requests 항목을 Disabled로 설정합니다.

 

 

궁금한 점이 있으신 분들은 댓글 부탁드립니다.