api-screenshot
api-screenshot copied to clipboard
Docs: explain how to deal with CORS
I've installed this on my own domain screenshots.nicolas-hoizey.com hosted on Netlify.
It works well when run in the browser: https://screenshots.nicolas-hoizey.com/https%3A%2F%2Fcloudfour.com%2Fthinks%2Fsvg-icon-stress-test%2F/large/
But I get a CORS error when I try to use this image in a page on another domain:
I tried to add this to my netlify.toml
file, but it doesn't fix the issue:
[[headers]]
for = "/*"
[headers.values]
Access-Control-Allow-Origin = "*"
Is there something specific to do because it's a Netlify Function?
There might be something here: https://stackoverflow.com/a/57974136/717195