Prevent Rust from falling victim to trailing slashitis

This commit is contained in:
Duke Leto
2021-05-21 17:04:41 -04:00
parent 3de22a07a7
commit fe6f38d0bd

View File

@@ -30,6 +30,11 @@ Config Settings::getSettings() {
bool sticky = s.value("connection/stickyServer").toBool();
bool torOnly = s.value("connection/torOnly").toBool();
while (server.endsWith("/")) {
// trailing slashes make Rust sad
server.chop(1);
}
// Users that have old configs generated from old SDLs will have this hostname
if(server == malicious or server == (QString("https://") + malicious)) {
qDebug() << "Replacing malicious SDL server with " << server;