Fix loading of URL without scheme (fixes issue #3079)

This commit is contained in:
Cristian Amarie 2021-02-10 18:30:43 +00:00 committed by Marshall Greenblatt
parent 5ef0fb8ac8
commit 59c11404e6
1 changed files with 7 additions and 0 deletions

View File

@ -350,6 +350,13 @@ void CefFrameHostImpl::LoadURLWithExtras(const std::string& url,
// Any necessary fixup of the URL will occur in
// [CefBrowserHostBase|CefFrameHostImpl]::Navigate().
GURL gurl(url);
if (!url.empty() && !gurl.is_valid() && !gurl.has_scheme()) {
std::string fixed_scheme(url::kHttpScheme);
fixed_scheme.append(url::kStandardSchemeSeparator);
std::string new_url = url;
new_url.insert(0, fixed_scheme);
gurl = GURL(new_url);
}
if (frame_id == CefFrameHostImpl::kMainFrameId) {
// Load via the browser using NavigationController.