mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
Browser: Default to HTTPS instead of HTTP if no protocol is specified
This commit is contained in:
parent
1a1ff8eb5e
commit
8ce1b7ab7e
1 changed files with 1 additions and 1 deletions
|
@ -54,7 +54,7 @@ URL url_from_user_input(DeprecatedString const& input)
|
||||||
if (input.starts_with('?') && !g_search_engine.is_empty())
|
if (input.starts_with('?') && !g_search_engine.is_empty())
|
||||||
return URL(g_search_engine.replace("{}"sv, URL::percent_encode(input.substring_view(1)), ReplaceMode::FirstOnly));
|
return URL(g_search_engine.replace("{}"sv, URL::percent_encode(input.substring_view(1)), ReplaceMode::FirstOnly));
|
||||||
|
|
||||||
URL url_with_http_schema = URL(DeprecatedString::formatted("http://{}", input));
|
URL url_with_http_schema = URL(DeprecatedString::formatted("https://{}", input));
|
||||||
if (url_with_http_schema.is_valid() && url_with_http_schema.port().has_value())
|
if (url_with_http_schema.is_valid() && url_with_http_schema.port().has_value())
|
||||||
return url_with_http_schema;
|
return url_with_http_schema;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue