Fix handling of IPv6 literals with port numbers

This commit is contained in:
Cameron Gutman 2023-03-18 14:47:23 -05:00
parent 65b6885c61
commit 5e6b60bae0

View file

@ -658,8 +658,8 @@ void ComputerManager::stopPollingAsync()
void ComputerManager::addNewHostManually(QString address)
{
QUrl url = QUrl::fromUserInput(address);
if (url.isValid() && !url.host().isEmpty()) {
QUrl url = QUrl::fromUserInput("moonlight://" + address);
if (url.isValid() && !url.host().isEmpty() && url.scheme() == "moonlight") {
// If there wasn't a port specified, use the default
addNewHost(NvAddress(url.host(), url.port(DEFAULT_HTTP_PORT)), false);
}