본문 바로가기

Trouble Shootings

CORS 에러: The request client is not a secure context and the resource is in more-private address space `local`.

웹서비스를 개발 하던 중 위와 같은 에러를 만났다. 서버 응답에 Access-Control-Allow-Origin: * 와 같은 CORS 허용 헤더를 다 넣어줬지만 위와 같은 에러가 계속 발생했다. 알고보니 origin 보다 더 낮은 수준의 네크워크로 요청을 보내는 경우, 위와같이 에러를 발생한다.

 

이를 해결하기 위해서는 브라우져 설정에서, 위와 같은 제한을 해제해주어야 한다. 그리고 당연한 소리겠지만, 운영 환경에서는 위와 같은 상황이 발생하면 안된다.

  • 크롬의 경우: chrome://flags/#block-insecure-private-network-requests 에 들어가서 설정 disabled
  • 엣지의 경우: edge://flags/#block-insecure-private-network-requests 에 들어가서 설정 disabled

 

 

참고 - https://nankisu.tistory.com/70

       - https://wicg.github.io/private-network-access/

728x90