I guess the safest variant would be to read the already loaded images from the DOM (and also faster).
Otherwise APIs to fetch data can often decide whether they go with or without CORS.
Is the referring domain is always localhost or something like that?
Anyway, most libraries and native APIs can set something like the no-cors property and disable the check in this case.
Otherwise it might be possible to set the Referer HTTP header to the current domain in these requests.
Hi
0x6b
,I hope you're fine.
Actual Result
I tried to copy something and it failed due to a CORS rule when trying to fetch images.
I guess the safest variant would be to read the already loaded images from the DOM (and also faster).
Otherwise APIs to fetch data can often decide whether they go with or without CORS. Is the referring domain is always
localhost
or something like that? Anyway, most libraries and native APIs can set something like theno-cors
property and disable the check in this case.Otherwise it might be possible to set the
Referer
HTTP header to the current domain in these requests.Expected Result
No CORS errors. :wink: