javascript - 从 http 而不是 https 加载图像时出现 403 错误

标签 javascript jquery html image http

我的问题类似于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/

相关文章:

javascript - colorbox 内的 jQuery 不工作

javascript - body 垂直滚动适配?

javascript - 如何在对象数组中搜索给定数组的元素并从中获取一些值?

javascript - 将数组中的相似记录分组为一个键?

javascript - 对不同的页面和 div 使用一个 ajax 调用?

jquery - 在 GMAP3 和 JQuery 中平移和缩放到特定坐标

php - http请求部分响应

javascript - 使用 CSS 将 pre 元素另存为 PDF

javascript - 在 javascript 代码中使用 ASP.net 模型。除了使用 <text> 之外还有其他方法吗?

javascript - jQuery 动画无法在左侧位置工作