VAST 서버용 CORS 구성
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
최신 브라우저는 JavaScript 네트워크에 동일 출처 보안 제한을 적용합니다.
즉, 한 출처에서 실행되는 웹 애플리케이션이
다른 출처에서 제공된 데이터를
확인할 수 있습니다 VAST의 경우 이러한 보안 제한으로 인해
JavaScript VAST 렌더링 코드에서 만든 JavaScript XMLHttpRequests
는
다른 출처에서 제공된 VAST 광고 응답을 반환합니다.
이러한 보안 제한은 한 사용자가 다른 출처에서 데이터를 공유할 수 있는
다른 출처의 데이터를 읽을 수 있지만
권한을 부여할 수 있습니다. 자바스크립트에 게재되는 VAST에 문제를 일으킬 수 있는 제한사항
광고 서버가 현재 사이트와 다른 도메인에 있는 경우가 많기 때문에
있습니다.
교차 출처 리소스 공유 (CORS) 헤더는 Google Cloud Storage의
서로 다른 출처 간에 공유할 수 있습니다. 자바스크립트에서 게재할 수 있도록 하기 위해
환경에서 VAST 광고 서버의 응답에 다음 HTTP CORS 헤더가 포함되어야 합니다.
Access-Control-Allow-Origin: <origin header value>
Access-Control-Allow-Credentials: true
드림
이 HTTP 헤더를 사용하면 모든 출처의 광고 플레이어가 VAST 응답을 읽을 수 있습니다.
추출해야 합니다.
Access-Control-Allow-Origin:
의 값
광고 요청과 함께 전송된
Origin
헤더의 값이어야 합니다.
Access-Control-Allow-Credentials:
헤더는
올바르게 전송되고 수신되는지 확인해야 합니다.
자세한 내용은 교차 출처 리소스 공유에 대한 W3C 드래프트 사양을 참조하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-31(UTC)
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eModern browsers restrict JavaScript from accessing data from different origins for security reasons, impacting VAST ad serving.\u003c/p\u003e\n"],["\u003cp\u003eThis restriction prevents JavaScript in VAST ads from loading resources like the ad response if they are hosted on a different domain than the player.\u003c/p\u003e\n"],["\u003cp\u003eCross-Origin Resource Sharing (CORS) headers enable cross-origin data access, requiring VAST ad servers to include specific headers to allow JavaScript ad players to read responses.\u003c/p\u003e\n"],["\u003cp\u003eThese CORS headers, \u003ccode\u003eAccess-Control-Allow-Origin\u003c/code\u003e and \u003ccode\u003eAccess-Control-Allow-Credentials\u003c/code\u003e, specify permitted origins and ensure proper cookie handling for seamless ad delivery.\u003c/p\u003e\n"]]],[],null,["# Configure CORS for VAST servers\n\nModern browsers apply same-origin security restrictions to JavaScript network\nrequests, meaning that a web application running from one origin cannot retrieve data\nserved from a different origin. For VAST, this security restriction prevents\nJavaScript `XMLHttpRequests` made from JavaScript VAST rendering code from reading\na VAST ad response served from a different origin.\n\n\nThis security restriction is meant to prevent issues where one origin is able\nto read data from another origin that a user may be logged into without that\nuser's permission. The restriction poses problems for VAST served in a JavaScript\nenvironment because an ad server is often on a different domain than the\nads player.\n\n\nCross-Origin Resource Sharing (CORS) headers is a W3C draft specification meant\nto allow sharing across different origins. To be servable in a JavaScript\nenvironment a VAST ad server's response must include the following HTTP CORS headers: \n\n```text\nAccess-Control-Allow-Origin: \u003corigin header value\u003e\nAccess-Control-Allow-Credentials: true\n```\nThis HTTP header allows an ads player on any origin to read the VAST response from the ad server origin. The value of `Access-Control-Allow-Origin:` should be the value of the `Origin` header sent with the ad request. The `Access-Control-Allow-Credentials:` header ensures that cookies are sent and received properly.\n\n\u003cbr /\u003e\n\n\nFor more information, refer to the [W3C Draft Specification on Cross-Origin Resource Sharing](//www.w3.org/TR/cors)"]]