Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d8c2d27

Browse files
author
Fabian Müller
committedMay 2, 2022
Use HTTPS if no scheme has been provided in wizard
1 parent 9d1585e commit d8c2d27

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/gui/newwizard/setupwizardcontroller.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ void SetupWizardController::nextStep(std::optional<PageIndex> currentPage, std::
101101

102102
// fix scheme if necessary
103103
// using HTTPS as a default is a really good idea nowadays, users can still enter http:// explicitly if they wish to
104-
if (QUrl(userProvidedUrl).isRelative() && !userProvidedUrl.isEmpty()) {
105-
userProvidedUrl.prepend(QStringLiteral("https://"));
104+
if (!userProvidedUrl.startsWith(QStringLiteral("http://")) && !userProvidedUrl.startsWith(QStringLiteral("https://"))) {
105+
static const QString defaultScheme(QStringLiteral("https://"));
106+
qDebug() << "no URL scheme provided, prepending" << defaultScheme;
107+
userProvidedUrl.prepend(defaultScheme);
106108
}
107109

108110
return QUrl::fromUserInput(userProvidedUrl);

0 commit comments

Comments
 (0)
Please sign in to comment.