边缘浏览器似乎放弃了响应负载 [英] Edge browser appears to discard response payload

查看:421
本文介绍了边缘浏览器似乎放弃了响应负载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web应用程序,可将PDF返回到浏览器,该浏览器在Chrome和Firefox中运行良好,但是在Edge(版本38.14393.0.0)中不起作用.响应标头如下所示:

I have a web app that returns a PDF to the browser, which works fine in Chrome and Firefox, however it does not work in Edge (version 38.14393.0.0). The response header looks like this:

   Access-Control-Allow-Headers: Content-Type, Authorization
   Access-Control-Allow-Origin: *
   Cache-Control: no-store, no-cache, must-revalidate
   Content-Disposition: inline; filename="Invoice.PDF"
   Content-Length: 9255
   Content-Type: application/pdf
   Date: Mon, 30 Jan 2017 04:38:25 GMT
   Pragma: no-cache
   Server: Microsoft-IIS/10.0

我还看到其他问题,表明有2个请求是从Edge发送的,其中一个应被忽略,但是在我的情况下,只有一个,并且由于Edge报告,有效负载似乎被忽略了.

I've seen other questions suggesting that 2 requests are sent from Edge, one of which should be ignored, but in my case there is only one, and it appears that the payload is being ignored because Edge reports:

This resource has no response payload data

..位于响应主体部分中,用于开发人员工具中网络分析器中的请求.使用附件而不是内联也不起作用,而且如果Edge认为响应中没有内容,我也不会期望这样做.

..which is in the Response Body section for the request in the Network analyzer in Developer Tools. Using attachment instead of inline also does not work, and I wouldn't expect it to if Edge thinks there's no content in the response.

有任何线索吗?

当Content-Type更改为:text/plain时,响应主体不再被丢弃(但不能解决问题),因此我认为它是特定于application/pdf的

When the Content-Type is changed to: text/plain, the response body is no longer being discarded (but does not solve the problem), so I assume it's something specific to application/pdf

推荐答案

在我的情况下,由于我试图在结果上使用createObjectURL,因此似乎丢弃了有效载荷数据.这篇文章:

In my case, it appears the payload data is being discarded because I was attempting to use createObjectURL on the result. This post:

设置"窗口. AngularJS中的location或window.open给出拒绝访问"信息.在IE 11中

有一种可行的解决方案:Edge仍然无法像其他浏览器一样真正打开PDF,但是它为用户提供了保存文件的选项.

Has a solution that kind of works: Edge still does not actually open the PDF like other browsers are capable of, however it gives the user the option to save it.

这篇关于边缘浏览器似乎放弃了响应负载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆