-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Correctly validate the response status for non-HTTP fetch requests (PR 8768 follow-up) #8866
Correctly validate the response status for non-HTTP fetch requests (PR 8768 follow-up) #8866
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove entire if(!isHttp) statement. Not sure if fetch() for file: protocol is returning 0 for success.
Fixed now, thanks!
According to https://fetch.spec.whatwg.org/#scheme-fetch, it would seem that |
…R 8768 follow-up) It seems that the status check, for non-HTTP loads, causes the default viewer to *refuse* to open local PDF files. ***STR:*** 1. Make sure that fetch support is enabled in the browser. In Firefox Nightly, set `dom.streams.enabled = true` and `javascript.options.streams = true` in `about:config`. 2. Open https://mozilla.github.io/pdf.js/web/viewer.html. 3. Click on the "Open file" button, and open a new PDF file. ***ER:*** A new PDF file should open in the viewer. ***AR:*** The PDF file fails to open, with an error message of the following format: `Message: Unexpected server response (200) while retrieving PDF "blob:https://mozilla.github.io/a4fc455f-bc05-45b5-b6aa-2ecff3cb45ce".`
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/491b20fe9aed89e/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/491b20fe9aed89e/output.txt Total script time: 2.32 mins Published |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/faf8c29db700c60/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/4016277e2bbd6d7/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/4016277e2bbd6d7/output.txt Total script time: 29.66 mins
Image differences available at: http://54.215.176.217:8877/4016277e2bbd6d7/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/faf8c29db700c60/output.txt Total script time: 60.00 mins |
/botio-linux test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://54.67.70.0:8877/4b687477818032a/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/4b687477818032a/output.txt Total script time: 16.44 mins
|
Thank you for the patch. |
|
…ateResponseStatus Correctly validate the response status for non-HTTP fetch requests (PR 8768 follow-up)
It seems that the status check, for non-HTTP loads, has been inverted which causes the default viewer to refuse to open local PDF files. Follow-up to PR #8768.
STR:
dom.streams.enabled = true
andjavascript.options.streams = true
inabout:config
. Edit: Just to clarify, please note that the issue is reproducible in Google Chrome too.ER:
A new PDF file should open in the viewer.
AR:
The PDF file fails to open, with an error message of the following format:
Message: Unexpected server response (200) while retrieving PDF "blob:https://mozilla.github.io/a4fc455f-bc05-45b5-b6aa-2ecff3cb45ce".
Edit: Fixes #8870.