When I fetch images from the Pixabay API:
fetch(`https://pixabay.com/api?key=${API_KEY}&per_page=7`)
I get the Mixed Content error:
Mixed Content: The page at 'https://my-page.com/' was loaded over HTTPS, but requested an insecure resource 'http://pixabay.com/api/?key=xxx&per_page=7'. This request has been blocked; the content must be served over HTTPS.
Which I don't understand, since I call https://pixabay.com from https://my-page.com. After inspecting the Network tab in the console, I see that there is 3 requests:
- The initial request that responds with a
301 Redirecttohttp://pixabay.com - The second request
http://pixabay.comthat responds with a307 Internal Redirecttohttps://pixabay.com - Finally the last request
https://pixabay.comthat responds with a200
Why all this redirects? Do I miss something obvious?
How to make the Pixabay API work properly with HTTPS?
