【问题标题】:Image in IE11 returned 200 with image data but did not show image. Click show picture, and then it showsIE11 中的图像返回 200 和图像数据,但没有显示图像。点击显示图片,然后显示
【发布时间】:2018-05-11 22:08:06
【问题描述】:

上下文(不确定是否相关)

我有一个通过 iframe 使用 Sharepoint 的身份验证过程...一旦身份验证发生,图像 src 将重新加载以显示图像。

问题

如果我查看提琴手,我可以看到整个身份验证过程发生......最后,我看到图像加载并返回 200。这个请求似乎包含图像数据。

在 IE 11 中,图像继续显示为损坏。但是,我然后单击上下文菜单中的“显示图片”,然后图像正确显示。

这是显示 200 但未显示的图像请求:

HTTP/1.1 200 OK
缓存控制:私有,max-age=86400
内容长度: 11219
内容类型: image/jpeg
ETag: "..."
服务器: Microsoft-IIS /8.5
Set-Cookie: rtFa=..;域=sharepoint.com;路径=/;安全的; HttpOnly
Set-Cookie: FedAuth=..;路径=/;安全的; HttpOnly
X-SharePointHealthScore: 0
Content-Disposition: 附件;文件名=.._com_LThumb.jpg
X-AspNet-Version: 4.0.30319
SPRequestGuid: ..
请求 ID: .. Strict-Transport-Security: max-age=31536000
X-FRAME-OPTIONS: SAMEORIGIN
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 16.0.0.6001
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
日期: 格林威治标准时间 2016 年 12 月 13 日星期二 11:29:02

图片的html:

<img width="65" height="65" id="user-profile-picture" onerror="SPImageLoader.ImageErrored(this)" alt="" src="https://something.com/_layouts/15/userphoto.aspx?size=L&amp;url=https://something.sharepoint.com/User%20Photos/Profile%20Pictures/something_com_LThumb.jpg" load-when-authenticated="">

问题:

你能告诉我会发生什么样的事情会导致这种情况发生吗?可能出了什么问题?

【问题讨论】:

    标签: image sharepoint


    【解决方案1】:

    这是因为 X-Content-Type-Options: nosniff 标头。 IE11 看到图片 content-type 不同。

    【讨论】:

      【解决方案2】:

      只包含

      <!--[if gte IE 8]>
       <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <![endif]-->
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-05-03
        • 2023-04-05
        • 1970-01-01
        • 2015-08-06
        • 2017-03-22
        • 1970-01-01
        • 1970-01-01
        • 2018-11-11
        相关资源
        最近更新 更多