Closed guest363 closed 2 years ago
Hello,
Thanks for the contribution, but I think that using a custom urlHandler
is more appropriate to your need.
VASTClient's get
method accepts a custom URLHandler
as an optional parameter https://github.com/dailymotion/vast-client-js/blob/master/docs/api/vast-client.md#parameters-1
const customUrlHandler = {
get(url, options, cb) {
// Add your fetch code with your CORS handling here
}
}
const vastClient = new VASTClient();
vastClient.get('http://example.dailymotion.com/vast.xml', options)
.then(res => {
// Do something with the parsed VAST response
})
.catch(err => {
// Deal with the error
});
Also I'm not sure to understand the need for %5B{key}%5D
macro pattern.
Macro pattern %5B
and %5D
is for support [
and ]
in url encode. That's actualy a not common case, but i faced this problem.
Custom URLHandler is a good desigion, thats will fix my broblem, thanks.
Got it 👍 I will close this PR, but feel free to open an issue if you face any other problem !
[client][parser] When you use in iframe on Safari vastClient can't get VAST. Request is block by CORS.
Description
Issue
Issue Link [Optional]
Type