diff options
author | zherczeg.u-szeged <zherczeg.u-szeged@partner.samsung.com> | 2014-12-04 03:52:36 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-04 11:52:52 +0000 |
commit | 1e2171c1d5c24b6738fce18f93a530664e265602 (patch) | |
tree | e3f68fc0958536d569658e02c9b63fbae7e0cf7e /url/url_util.cc | |
parent | 04cc61850af229752cb9875838ea5115f8904632 (diff) | |
download | chromium_src-1e2171c1d5c24b6738fce18f93a530664e265602.zip chromium_src-1e2171c1d5c24b6738fce18f93a530664e265602.tar.gz chromium_src-1e2171c1d5c24b6738fce18f93a530664e265602.tar.bz2 |
DoResolveRelative must not parse mailto schemes as path URLs.
Currently DoResolveRelative perform a ParsePathURL on those
URLs, which have a valid base_parsed_authority.host. However,
hash-mark (#) is not interpreted for mailto schemes, which
result an incorrect parsing.
BUG=413569
Review URL: https://codereview.chromium.org/767713002
Cr-Commit-Position: refs/heads/master@{#306803}
Diffstat (limited to 'url/url_util.cc')
-rw-r--r-- | url/url_util.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/url/url_util.cc b/url/url_util.cc index 8ab889f..008a5e4 100644 --- a/url/url_util.cc +++ b/url/url_util.cc @@ -238,15 +238,16 @@ bool DoResolveRelative(const char* base_spec, Parsed base_parsed_authority; ParseStandardURL(base_spec, base_spec_len, &base_parsed_authority); if (base_parsed_authority.host.is_nonempty()) { + RawCanonOutputT<char> temporary_output; bool did_resolve_succeed = ResolveRelativeURL(base_spec, base_parsed_authority, false, relative, - relative_component, charset_converter, output, - output_parsed); + relative_component, charset_converter, + &temporary_output, output_parsed); // The output_parsed is incorrect at this point (because it was built // based on base_parsed_authority instead of base_parsed) and needs to be // re-created. - ParsePathURL(output->data(), output->length(), true, - output_parsed); + DoCanonicalize(temporary_output.data(), temporary_output.length(), true, + charset_converter, output, output_parsed); return did_resolve_succeed; } } else if (is_relative) { |