Blocked by cors policy

I use shape diver Api v3,
and i want to download a file (the exported file dxf) with ajax/fetch, but some times i’m blocked by cors,
but i can download it with the navigator (just paste link).
the problem is with this line fetch(response.content[0].href)
some one have an idea?

Did you try what the error message suggests (set option mode of fetch to no-cors)?

thank’s for your response, i tried fetch(response.content[0].href, { mode: 'no-cors'})
but i have the empty response
Capture d’écran 2022-08-16 à 15.46.34

Do you get the CORS error on every export request, or just for local development?

it been happened in production on server and local.
when I execute the query several times in a row it blocked by cors,
and the blocking is intermittent.
i will provide you more data tomorrow

Many thanks for reporting this problem. I have a suspicion what the reason might be: Recently we introduced a CDN feature for all paid accounts. This means that download links for all assets, including the exported files, are pointing to a CDN. This makes the downloads significantly faster. The download links are pre-signed, they contain a signature which is valid for two (2) minutes. In case you are using the link after this validity period, the download will most probably fail with a CORS error. In your browser console network tab, you will probably see a 403 error. Is this the case?
In case this CDN feature is causing a problem for you, we could temporarily switch it off again for your user account, until a long term solution for the problem has been identified.

thanks for your response, actually it works properly,
I will give you my feed backs about the problem soon,