api-screenshot icon indicating copy to clipboard operation
api-screenshot copied to clipboard

Docs: explain how to deal with CORS

Open nhoizey opened this issue 3 years ago • 0 comments

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: image

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

nhoizey avatar Oct 30 '21 14:10 nhoizey