我的问题类似于this one ,但我只使用 html 和 javascript。
如果我尝试通过 https 加载此图像,它会很好地显示图像。
<img src="http://ia.media-imdb.com/images/M/MV5BMjEyMjcyNDI4MF5BMl5BanBnXkFtZTcwMDA5Mzg3OA@@._V1_SX100.jpg">
除了这个警告
Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure image 'http://ia.media-imdb.com/images/M/MV5BMjEyMjcyNDI4MF5BMl5BanBnXkFtZTcwMDA5Mzg3OA@@._V1_SX100.jpg'. This content should also be served over HTTPS.
但是通过 http 会产生 403 错误。
GET http://ia.media-imdb.com/images/M/MV5BMjEyMjcyNDI4MF5BMl5BanBnXkFtZTcwMDA5Mzg3OA@@._V1_SX100.jpg 403 (Forbidden)
我不明白为什么,因为图像网址是http。
知道该怎么做吗?
非常感谢!
最佳答案
这被称为“bandwidth theft ”或更确切地说是预防。
通过 HTTPS,您的引荐来源网址不会被发送,但通过 HTTP,则会发送。在后一种情况下,IMDb 显然拒绝在您的网站上显示他们的 Assets 。如果您访问以下网址,也会显示此信息:“推荐被拒绝”。
您是not allowed to link to or rehost IMDb assets :
Framing: You may not frame or utilize framing techniques to enclose any trademark, logo, or other proprietary information (including images, text, page layout, or form) of IMDb without express written consent.
关于javascript - 从 http 而不是 https 加载图像时出现 403 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28676608/