From 8d6ee5aad20ecf69a7f59bd8c7fb416a0db87eda Mon Sep 17 00:00:00 2001 From: Boik Date: Sat, 15 Jul 2017 10:32:46 +0800 Subject: [PATCH] add some minor fixes --- atom/browser/atom_resource_dispatcher_host_delegate.cc | 7 ++++--- atom/browser/atom_web_ui_controller_factory.cc | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/atom/browser/atom_resource_dispatcher_host_delegate.cc b/atom/browser/atom_resource_dispatcher_host_delegate.cc index 53c7cf09403..19359e2ca54 100644 --- a/atom/browser/atom_resource_dispatcher_host_delegate.cc +++ b/atom/browser/atom_resource_dispatcher_host_delegate.cc @@ -86,10 +86,11 @@ void OnPdfResourceIntercepted( // 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)); content::NavigationController::LoadURLParams params( - GURL(base::StringPrintf("%sindex.html?%s=%s", kPdfViewerUIOrigin, - kPdfPluginSrc, escaped_url.spec().c_str()))); + GURL(base::StringPrintf("%sindex.html?%s=%s", + kPdfViewerUIOrigin, + kPdfPluginSrc, + net::EscapeUrlEncodedData(original_url.spec(), false).c_str()))); web_contents->GetController().LoadURLWithParams(params); } diff --git a/atom/browser/atom_web_ui_controller_factory.cc b/atom/browser/atom_web_ui_controller_factory.cc index 57a76e05cc7..d113e656084 100644 --- a/atom/browser/atom_web_ui_controller_factory.cc +++ b/atom/browser/atom_web_ui_controller_factory.cc @@ -55,10 +55,9 @@ AtomWebUIControllerFactory::CreateWebUIControllerForURL(content::WebUI* web_ui, std::string stream_id, src; const net::UnescapeRule::Type unescape_rules = - net::UnescapeRule::SPOOFING_AND_CONTROL_CHARS | net::UnescapeRule::SPACES | net::UnescapeRule::PATH_SEPARATORS | net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS | - net::UnescapeRule::NORMAL | net::UnescapeRule::REPLACE_PLUS_WITH_SPACE; + net::UnescapeRule::REPLACE_PLUS_WITH_SPACE; for (const auto& param : toplevel_params) { if (param.first == kPdfPluginSrc) {