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 thedocs :

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>
 
 
时间: 2024-10-10 08:24:26

access-control-allow-origin的相关文章

Access control allow origin 简单请求和复杂请求

错误信息: XMLHttpRequest cannot load http://web.image.myqcloud.com/photos/v2/10008653/bhpocket/0/?sign=4FcLKd5B8-p4SkFVUEJtZ1omZT0xNDQ0NzExMDE5JnQ9MTQ0NDcwNzQxOSZyPTEzMDMyMDgzOTAmdT0wJmY9.No 'Access-Control-Allow-Origin' header is present on the requeste

关于Access Control Allow Origin错误的问题

前天第一次使用jquery向服务器发送Get请求.结果吸拜了...查看console提示说"No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.",嗯好吧,google了一下才知道是跨域问题. 跨域访问:AJAX 跨域访问是用户访问A网站时所产生的对B网站的跨域访问请求均提交到A网站的指定页面

Server-Side Access Control

Firefox 3.5 implements the W3C Access Control specification.  As a result, Firefox 3.5 sends specific HTTP headers for cross-site requests initiated from withinXMLHttpRequest (which in Firefox 3.5 and beyond can be used to invoke different domains) a

Browser security standards via access control

A computing system is operable to contain a security module within an operating system. This security module may then act to monitor?access?requests by a web browser and apply?mandatory?access?control?security policies to such requests. It will be ap

Access control differentiation in trusted computer system

A trusted computer system that offers Linux? compatibility and supports contemporary hardware speeds. It is designed to require no porting of common applications which run on Linux, to be easy to develop for, and to allow the use of a wide variety of

CISSP AIO 3th: Access Control

This chapter presents the following: • Identification methods and technologies • Authentication methods, models, and technologies • Discretionary, mandatory, and nondiscretionary models • Accountability, monitoring, and auditing practices • Emanation

A GUIDE TO UNDERSTANDINGDISCRETIONARY ACCESS CONTROL INTRUSTED SYSTEMS

1. INTRODUCTION ? The main goal of the National Computer Security Center is to encourage the widespread availability of trusted computer systems. In support of that goal a metric was created, the Department of Defense Trusted Computer System Evaluati

Enhancing network controls in mandatory access control computing environments

A?Mandatory?Access?Control?(MAC) aware firewall includes an extended rule set for MAC attributes, such as a security label or path. Application labels may be used to identify processes and perform firewall rule-checking. The firewall rule set may inc

【MongoDB】The Access control of mongodb

In this blog we mainly talk about the access control including limitation of ip, setting listen port and usage of username and password. In the official document, mongodb server start without the argument , so once the connection was created, the rem

Exclusive access control to a processing resource

A data processing system is provided with multiple processors that share a main memory. Semaphore values associated with data elements within the memory system, including the main memory, are used to establish exclusive access permissions to those da