From f74b3d7673660b6bfd6e45017fc914d8ee485b4b Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 3 Dec 2024 06:15:17 +0100 Subject: [PATCH] Axivion: Fix url construction We need to encode the project name as it could contain symbols which let further modification of the url fail in unexpected ways. Fixes: QTCREATORBUG-32091 Change-Id: Ic9109aef5b5e64aea48f7dc2068003ca7f54a048 Reviewed-by: hjk --- src/plugins/axivion/axivionplugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 28fb094ae22..897751c6c02 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -361,7 +361,9 @@ static QUrl constructUrl(const QString &projectName, const QString &subPath, con { if (!dd->m_dashboardInfo) return {}; - QUrl url = dd->m_dashboardInfo->source.resolved(QString("api/projects/" + projectName + '/')); + const QByteArray encodedProjectName = QUrl::toPercentEncoding(projectName); + const QUrl path(QString{"api/projects/" + QString::fromUtf8(encodedProjectName) + '/'}); + QUrl url = dd->m_dashboardInfo->source.resolved(path); if (!subPath.isEmpty() && QTC_GUARD(!subPath.startsWith('/'))) url = url.resolved(subPath); if (!query.isEmpty())