-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Fix a query string parsing problem happend to PDF Viewer #10008
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
Conversation
|
Would it be possible to add a new spec for this as well? |
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.
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)); |
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.
-
Result of
net::EscapeUrlEncodedDatacan be used directly in the final url creation below,escaped_urlGURLis not required. -
the
use_plusparameter should be invoked with false, since we usenet::UnescapeRule::SPACESbelow.
| base::SplitStringIntoKeyValuePairs(url.query(), '=', '&', &toplevel_params); | ||
| std::string stream_id, src; | ||
|
|
||
| const net::UnescapeRule::Type unescape_rules = |
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.
SPOOFING_AND_CONTROL_CHARS should be avoided. Also NORMAL rule need not be specified, any rule specified includes the normal rule by default.
|
@kevinsawicki I'll see if I can figure out a way to add a new spec for this! |
|
@kevinsawicki A new spec has been added, and all checks have been passed as well. 😃 |
👍 Thanks for fixing this 🚢 |
This PR should resolve #10007.