-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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 #7701: additional check for http/https protocols to fix unsafe he… #7803
Conversation
@@ -377,6 +377,10 @@ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('FIREFOX || MOZCENTRAL')) { | |||
var networkManager = this._manager; | |||
var fullRequestXhrId = this._fullRequestId; | |||
var fullRequestXhr = networkManager.getRequestXhr(fullRequestXhrId); | |||
if (networkManager.isHttp) { |
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.
Hasn't this condition accidentally become inverted!?
As far as I understand, we want to prevent issues when the request is not http
or https
, and this condition actually does the opposite!
So, I'd assume that you mean:
if (!networkManager.isHttp) {
return false;
}
Also, let's move this code block up to just after the var networkManager = this._manager;
line instead.
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.
Oh sorry, i accidentally missed '!'.
Also, let's move this code block up to just after the var networkManager = this._manager; line instead.
Okay, i will fix that, Thanks.
if (networkManager.isHttp) { | ||
return false; | ||
} | ||
|
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.
Nit: Please remove trailing whitespace.
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.
Okay, Please find the PR below. Thanks for your review.
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.
Please squash the commits, see https://github.com/mozilla/pdf.js/wiki/Squashing-Commits.
…safe header request. add missing ! and removed trailing whitespaces.
3e6c3a1
to
6ce2be9
Compare
@Snuffleupagus, sorry for that, i am a beginner, and thanks for your advice. I will take care of that from now. Please guide me if i am making any mistake. ThankYou |
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/e690a8949e28b0c/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/9f556839494fe20/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/9f556839494fe20/output.txt Total script time: 26.01 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/e690a8949e28b0c/output.txt Total script time: 38.62 mins
|
No worries! For future reference, https://github.com/mozilla/pdf.js/wiki/Contributing contains a lot of useful resources/information about the contribution work flow. Thank you for the patch! |
Fix mozilla#7701: additional check for http/https protocols to fix unsafe he…
…ader request.