Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected server response (206) while retrieving PDF... #7754

Closed
godwin668 opened this issue Oct 26, 2016 · 6 comments
Closed

Unexpected server response (206) while retrieving PDF... #7754

godwin668 opened this issue Oct 26, 2016 · 6 comments
Labels

Comments

@godwin668
Copy link

Link to PDF file (or attach file here): http://api.idocv.com/view/KeDWwzf

Configuration:

  • Web browser and its version: 微信WeChat 6.3.27
  • Operating system and its version: IOS 10.0.3
  • PDF.js version: PDF.js v1.5.337
  • Is an extension:

Steps to reproduce the problem:

  1. Open 微信WeChat
  2. Wiew http://api.idocv.com/view/KeDWwzf

What is the expected behavior? (add screenshot)

What went wrong? (add screenshot)
Unexpected server response (206) while retrieving PDF...
image

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

@wslpeter
Copy link

wslpeter commented Oct 28, 2016

the same problem,version 1.6.210

@Snuffleupagus
Copy link
Collaborator

This may be related to #5405 (comment), try setting PDFJS.disableRange = true; and see if that helps.

@Lyife
Copy link

Lyife commented Nov 1, 2016

Seems like setting PDFJS.disableRange = true; it's helps in iOS 10.0.1, but in iOS 10.1.0 can not load PDF file ,hasn't loading bar and exception tips , just black page.

@Snuffleupagus
Copy link
Collaborator

Closing as fixed by PR #7800.

@godwin668
Copy link
Author

@Snuffleupagus The problem still exist.
As I mentioned before, I tested in WeChat App in iPhone, NOT safari in iPhone.
Safari in iPhone is OK, but app in iPhone does NOT work.

@tenente22
Copy link

@Snuffleupagus I have the same problem of @Lyife but in iOS 10.1.1.

I tried to set PDFJS.disableRange = true and changecheckRangeRequests in compatibility.js but I have a black page.

godwin668 added a commit to godwin668/pdf.js that referenced this issue Nov 16, 2016
godwin668 added a commit to godwin668/pdf.js that referenced this issue Nov 17, 2016
Better way but NOT necessarily best way to solve the IOS webview APP error: Unexpected server response (206) while retrieving PDF...

Details:
1. At the beginning, I only found the Error in IOS WeChat APP, so I solved it by checking WeChat:
9ad57d4

2. But I found this error in other IOS app, so I checked UA details of them as follow:

a) iPhone WeChat APP UserAgent (Fail):
Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Mobile/14B100 MicroMessenger/6.3.30 NetType/WIFI Language/zh_CN

b) iPhone Other APP UserAgent (Fail):
Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac X) AppleWebKit/602.2.14 (KHTML, like Gecko) Mobile/14B100 QYZone

Maybe all webview app in IOS 10 have this problem, and since Safari & Chrome in IOS also does NOT support range request in IOS, so I think it's a better way to disable range request in iPhone by this regex:
var isIPhone = /iPhone/.test(navigator.userAgent);
if (isIPhone) {
    PDFJS.disableRange = true;
    PDFJS.disableStream = true;
}

solve issues:
mozilla#7815
mozilla#7754
mozilla#7800
@mozilla mozilla deleted a comment from blluice Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants