1
Fork 0
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:
Andreas Kling 2023-05-23 10:19:59 +02:00 committed by Jelle Raaijmakers
parent 1a1ff8eb5e
commit 8ce1b7ab7e

View file

@ -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;