I have a web site that exports reports to various file formats by posting a form with a target in an iframe, and the http response is a file that downloads.
In the past, my web server and html/js assets were all hosted together in same domain, and all the browsers worked fine.
I just moved my static assets to a cdn on a different domain, and allow that domain on my web site using access-control-allow-origin
, x-frame-options allow-from
, and content-security-policy frame-ancestors
. The report exporting works fine on Chrome and Firefox, but no longer works on either Microsoft Edge or IE browsers.
On Edge, the developer tools network trace shows that the POST
to the server is "Pending" and never completes, yet there is no server log of the request. On IE, the HTTP POST
does complete fine, but the browser doesn't prompt to save the file. On both browsers, the developer tools show that there is no Origin
HTTP header, which is crucial for setting thex-frame-options
response. So that might explain why IE refused to save the file. But Edge doesn't even submit the request.
My questions are:
- Why won't edge submit the HTTP
POST
? - Why does neither browser send the HTTP
Origin
header? Am I supposed to rely on theReferer
header?