Failed to load resource: the server responded with a status of 403 () 问题解决

今天我发现我的网站的图片,在 mac 系统中的 Safari 浏览器中不显示。

为了一探究竟,我就开始调试,看看到底是咋回事。因为谷歌浏览器就是好的,Safari 上的图片却不显示。

一打开,控制台,发现报了一个 403 错误。“Failed to load resource: the server responded with a status of 403 ()”,翻译过来就是说,加载资源是不,服务器响应状态为403(禁止)。

Failed to load resource: the server responded with a status of 403 ()

403 一般代表没有权限等。但是明明我这个是可以用谷歌浏览器访问的啊,为什么一到 Safari 浏览器就 403 呢?

继续查看网络详情,发现 Safari 在请求这个图片时,传的 contentType 是 html,明明是一个 img 吗?为什么 contentType 被改成了 html,不应该是 jpg、png 等媒体格式吗?

Safari 是真坑。有人在 github 上提了 issues,表明这是 Safari 响应式设计模式问题,Masonry Safari 响应式设计模式问题。

后来,我发现是在 Safari 中 <figure> 标签,引起的问题,于是,我把 <figure> 标签改为 <p> 标签,完美解决。

原来是 <figure> 标签中包含<img>标签,我改为 <p> 标签中包含 <img> 标签。

Failed to load resource: the server responded with a status of 403 () 问题解决

: » Failed to load resource: the server responded with a status of 403 () 问题解决

原创文章,作者:3628473679,如若转载,请注明出处:https://blog.ytso.com/251105.html

(0)
上一篇 2022年5月2日
下一篇 2022年5月2日

相关推荐

发表回复

登录后才能评论