Chrome sends two requests when downloading a PDF (and cancels one of them)

前端 未结 3 1966
梦谈多话
梦谈多话 2020-12-14 08:25

I noticed that whenever you download a PDF in Chrome, it consistently makes two requests, and then cancels one of them. This is causing the request to be registered twice in

3条回答
  •  独厮守ぢ
    2020-12-14 08:48

    It looks like a bug in Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=587709

    The problem is that Chrome, when it loads an iframe that returns a PDF stream, writes an "embed" tag inside that iframe which again contains the same URL as the iframe. This triggers a request for that URL again, but Chrome immediately cancels it. (see the network tab) But by that time, the damage is done.

    We have the same issue here, and it does not occur in Firefox or IE.

    We're still looking for a good solution to this problem.

提交回复
热议问题