首页 > 代码库 > access-control-allow-origin
access-control-allow-origin
when use vastinspector to check our vast response ,it tiped :
"no ‘access-control-allow-origin‘ header is present on the requested resource. origin ‘https://imasdk.googleapis.com‘ is therefore not allow access " on the console ,
so we had to solve it ,to make sure our video play smoothly 。
according the docs :
Access-Control-Allow-Origin: <origin header value>
Access-Control-Allow-Credentials: true
we add headers before response:
origin := r.Header.Get("Origin") w.Header().Set("Access-Control-Allow-Origin", origin) w.Header().Set("Access-Control-Allow-Credentials", "true")
then our vast can play .
andskipable vast like this:
<VAST version="2.0"> <Ad id="159033832"> <InLine> <AdSystem>doubleclick</AdSystem> <Impression><![CDATA[ https://test.adomain.com/impression?k=598cf38025536d7377e2bcbb&p=NjAyOHwyODAwMHwwfDIyfDE1OTAzMzgzMnw3MDQzMDUwNzN8bm9ybWFsfGRvdWJsZWNsaWNrfDEyMDB4NjI3fDh8YW5kcm9pZHw2LjAuMHx8c20tZzYxMG18fHxVU3x8fHxub3JtYWx8fGNvbS5wb3dlcmQuY2xlYW5lcnx8fHx8fHx8NTk4Y2YzODAyNTUzNmQ3Mzc3ZTJiY2JifDUyLjIzLjExMi4wfHx8fHx8MHwwfDE4OWMzYTQ3LTViMWMtNDIwZi1hNzZlLTgxZWNhMDI1YTMxZHx8fHNhbXN1bmd8fHxyYW5rX2NwbV9jYW1wfHwzfHx8LHRiLGRiLHJlfHsiY2FycmllciI6IjcwMTE5IiwiY2l0eSI6ImFzaGJ1cm4iLCJjdHIiOiIwLjA1IiwiY3R5cGUiOiJjcG0iLCJwYXJzZSI6IjEiLCJyYW5rIjoiMCIsInJlcXR5cGUiOiJ2bmEiLCJzZWFyY2giOiIxIiwidHJhZmZpY190eXBlIjoiYXBwIn18MTUwMjQwOTYwMHx8MXwxMTkxNXx8fHx8fGh0dHBzOi8vcGxheS5nb29nbGUuY29t ]]></Impression> <Creatives> <Creative id="704305157"> <Linear skipoffset="00:00:05"> <Duration>00:00:23</Duration> <TrackingEvents> <Tracking event="start"><![CDATA[ https://analytics-test.adomain.com/collect?app_id=com.powerd.cleaner&advertiser_id=22&campaign_id ]]></Tracking> <Tracking event="midpoint"><![CDATA[ https://analytics-test.adomain.com/collect?app_id=com.powerd.cleaner&advertiser_id=22&campaign_id= <Tracking event="complete"><![CDATA[ https://analytics-test.adomain.com/collect?app_id=com.powerd.cleaner&advertiser_id=22&campaign_id= <VideoClicks> <ClickThrough><![CDATA[ https://test.adomain.com/click?k=598cf38025536d7377e2bcbb&p= ]]></ClickThrough> <ClickTracking /> </VideoClicks> <MediaFiles> <MediaFile id="1" delivery="progressive" type="video/mp4" bitrate="600" width="1280" height="720"><![CDATA[ https://d3e8xvf8dyclkj.cloudfront.net/cdn-adn/17/08/04/13/42/5984094d8709d.mp4 ]]></MediaFile> </MediaFiles> </Linear> </Creative> </Creatives> <Extensions> <Extension> <CustomTracking> <Tracking event="skip"><![CDATA[ https://test.xxx.com/impression?k=11&p=200 ]]></Tracking> </CustomTracking> </Extension> </Extensions> </InLine> </Ad> </VAST>
access-control-allow-origin
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。