Skip to content

Conversation

@qazbnm456
Copy link
Contributor

This PR should resolve #10007.

@kevinsawicki
Copy link
Contributor

Would it be possible to add a new spec for this as well?

Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires a few minor fixes, LGTM otherwise. Thanks @qazbnm456 !

// The URL passes the original pdf resource url, that will be requested
// by the webui page.
// chrome://pdf-viewer/index.html?src=https://somepage/123.pdf
GURL escaped_url(net::EscapeUrlEncodedData(original_url.spec(), true));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Result of net::EscapeUrlEncodedData can be used directly in the final url creation below, escaped_url GURL is not required.

  • the use_plus parameter should be invoked with false, since we use net::UnescapeRule::SPACES below.

base::SplitStringIntoKeyValuePairs(url.query(), '=', '&', &toplevel_params);
std::string stream_id, src;

const net::UnescapeRule::Type unescape_rules =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPOOFING_AND_CONTROL_CHARS should be avoided. Also NORMAL rule need not be specified, any rule specified includes the normal rule by default.

@qazbnm456
Copy link
Contributor Author

@kevinsawicki I'll see if I can figure out a way to add a new spec for this!
@deepak1556 Changes added. Thanks for your suggestions.

@qazbnm456
Copy link
Contributor Author

qazbnm456 commented Jul 15, 2017

@kevinsawicki A new spec has been added, and all checks have been passed as well. 😃

@kevinsawicki
Copy link
Contributor

A new spec has been added, and all checks have been passed as well. 😃

👍 Thanks for fixing this 🚢

@kevinsawicki kevinsawicki merged commit 1d9f69e into electron:master Jul 18, 2017
@qazbnm456 qazbnm456 deleted the fix-pdf-viewer branch July 18, 2017 16:33
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.

Cannot open the PDF file with the ampersand symbol existed in the url.

3 participants