나는 액시스를 통해 s3 서버를 요청하고 Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
을 받았습니다. 내가 가지고있어 OPTIONS https://s3.ap-northeast-2.amazonaws.com/.../... 403 (Forbidden)
오류 : 프리 플라이트 요청에 대한 응답이 액세스 제어 검사를 통과하지 못했습니다. 요청한 리소스에 'Access-Control-Allow-Origin'헤더가 있습니다.
나는이 문제를 클라이언트 측에서 해결해야한다. 내 로컬 컴퓨터에서 파일을 호스팅하고 있습니다. 내 요청 코드는 다음과 같습니다.
axios({
url: 'https://s3.ap-northeast-2.amazonaws.com/.../...',
method: 'get',
withCredentials: true,
headers: {
'Content-Type': 'image/jpeg',
'Access-Control-Allow-Origin': 'http://*, https://*',
}
은}) 나는 자식에게
start chrome --disable-web-security
을 시도 - 허용 - 제어 - 허용 - 원산지 : *
아무 일하지를 .. 이 문제를 어떻게 해결할 수 있습니까?
당신은'HTTPS에서 서버를 구성해야합니다. 그 서버에 액세스 할 수 있습니까? 그렇지 않은 경우 프록시를 통해 요청해야합니다. 자세한 내용은 https://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource/42744707#42744707에서 답변을 참조하십시오. * chrome --disable-web-security *를 시작하거나 플러그인을 설치하는 것은 문제의 해결책이 아닙니다. 앱 사용자에게는 문제가 해결되지 않습니다. – sideshowbarker