forked from qt-creator/qt-creator
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 <hjk@qt.io>
This commit is contained in:
@@ -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())
|
||||
|
Reference in New Issue
Block a user