| Index: shell/url_resolver.cc
|
| diff --git a/shell/url_resolver.cc b/shell/url_resolver.cc
|
| index b4b4ebee5163bb254c5abf69c3d44fd34475d072..d5e1e9998e1f6f161bba7e12e2347c3f136df4d0 100644
|
| --- a/shell/url_resolver.cc
|
| +++ b/shell/url_resolver.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/base_paths.h"
|
| #include "base/files/file_path.h"
|
| #include "base/logging.h"
|
| +#include "shell/application_manager/query_util.h"
|
| #include "shell/filename_util.h"
|
| #include "shell/switches.h"
|
| #include "url/url_util.h"
|
| @@ -64,7 +65,8 @@ void URLResolver::AddOriginMapping(const GURL& origin, const GURL& base_url) {
|
| }
|
|
|
| GURL URLResolver::ApplyMappings(const GURL& url) const {
|
| - GURL mapped_url(url);
|
| + auto url_and_suffix = GetBaseURLAndQuery(url);
|
| + GURL mapped_url = url_and_suffix.first;
|
| for (;;) {
|
| const auto& url_it = url_map_.find(mapped_url);
|
| if (url_it != url_map_.end()) {
|
| @@ -80,6 +82,8 @@ GURL URLResolver::ApplyMappings(const GURL& url) const {
|
| mapped_url.spec().substr(origin.spec().length()));
|
| }
|
|
|
| + if (url_and_suffix.second.length())
|
| + mapped_url = GURL(mapped_url.spec() + url_and_suffix.second);
|
| return mapped_url;
|
| }
|
|
|
| @@ -96,11 +100,9 @@ GURL URLResolver::ResolveMojoURL(const GURL& mojo_url) const {
|
| return mojo_url;
|
| } else {
|
| // It's still a mojo: URL, use the default mapping scheme.
|
| - std::string suffix = "";
|
| - if (mojo_url.has_query()) {
|
| - suffix = "?" + mojo_url.query();
|
| - }
|
| - std::string lib = mojo_url.host() + ".mojo" + suffix;
|
| + auto url_and_suffix = GetBaseURLAndQuery(mojo_url);
|
| + std::string lib =
|
| + url_and_suffix.first.host() + ".mojo" + url_and_suffix.second;
|
| return mojo_base_url_.Resolve(lib);
|
| }
|
| }
|
|
|