0
크롬 확장을 사용한 후에 교차 출처 요청을 할 수 있지만 확장을 사용하지 않고 요청을하려고합니다. 나는 다음과 같은 오류가 확장자를 사용하지 않는 내가 URL을 실수로 변경 한 경우,이 URL을 보여주는데크롬 익스텐션을 사용하지 않고 심플 앵글 js 클라이언트에서 크로스 원점 http 요청을하려면 어떻게해야합니까?
$http.get(URL+"?id="+$scope.source, {headers:{'Access-Control-Allow-Origin': '*'}}).then(function(response) {
some function.....
})
나는
XMLHttpRequest cannot load http://100.100.100.100:100. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
당신은 서버에 CORS를 활성화해야합니다. – John
코어를 활성화하는 것은 백엔드 문제이므로 프론트 엔드가 아니므로 백엔드 서버에서 활성화해야합니다. 많은 방법이 있습니다. –
아직도 이해할 수없는 것은 어떻게 크롬 확장이 CORS 문제를 피할 수 있었는지입니다. – snippetkid