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

Fix loading of PDF protected by cookie-based login #780

Merged
merged 1 commit into from
Nov 1, 2018

Conversation

yrliou
Copy link
Member

@yrliou yrliou commented Nov 1, 2018

brave/brave-browser#1287 was fixed in 0.57.x and later by #744.
This PR fixes it for 0.56.x without refactoring how we do cookie blocking.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests) on
    • Windows
    • macOS
    • Linux
  • Ran git rebase master (if needed).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

See brave/brave-browser#1788 (comment)

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

@kjozwiak
Copy link
Member

kjozwiak commented Nov 1, 2018

Approved uplift into 0.56.x-Beta. @rebron @srirambv also 👍 as well.

@bbondy
Copy link
Member

bbondy commented Nov 1, 2018

Thanks!

@bbondy bbondy merged commit 44f3cfe into 0.56.x Nov 1, 2018
@nomaed
Copy link

nomaed commented Nov 2, 2018

I'm not entirely sure if it's the same issue, but I'm seeing the following error when trying to view a PDF file in my Bank's website:

PDF.js v2.0.673 (build: 31012570)
Message: Failed to fetch

with the following 3 errors in the console:

GET https://hb2.bankleumi.co.il/.../uniquesig0/InternalSite/InternalError.asp?site_name=leumi&secure=1&error_code=109 net::ERR_TOO_MANY_REDIRECTS
PDFFetchStreamReader @ pdf.js:12454
getFullReader @ pdf.js:12407
(anonymous) @ pdf.js:5602
Promise @ pdf.js:8965
resolveCall @ pdf.js:8964
_createStreamSink @ pdf.js:9213
MessageHandler._onComObjOnMessage.event @ pdf.js:9055

Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Worker': TypeError: Failed to fetch could not be cloned.
    at MessageHandler.postMessage (chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/content/build/pdf.js:9331:19)
    at sendStreamRequest (chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/content/build/pdf.js:9158:12)
    at Object.error (chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/content/build/pdf.js:9198:9)
    at _fullReader.read.then.catch.reason (chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/content/build/pdf.js:5618:18)
postMessage @ pdf.js:9331
sendStreamRequest @ pdf.js:9158
error @ pdf.js:9198
_fullReader.read.then.catch.reason @ pdf.js:5618
Promise.catch (async)
sink.onPull @ pdf.js:5617
Promise @ pdf.js:8965
resolveCall @ pdf.js:8964
_processStreamMessage @ pdf.js:9266
MessageHandler._onComObjOnMessage.event @ pdf.js:9016

Uncaught (in promise) Error: An error occurred while loading the PDF.
    at loadingErrorMessage.then.msg (viewer.js:862)
loadingErrorMessage.then.msg @ viewer.js:862

@NejcZdovc NejcZdovc deleted the fix_cookie_based_auth_pdf branch November 2, 2018 11:12
@bbondy
Copy link
Member

bbondy commented Nov 2, 2018

Yep that should be fixed, mainly any site that you had to login to first and then you click to see a PDF would fail. Next week's release will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants