Skip to content

Commit

Permalink
[ssu] Don't break on query strings in predefined URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernd Wachter committed Apr 7, 2014
1 parent 053ec4f commit 499014f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ssuurlresolver/ssuurlresolver.cpp
Expand Up @@ -10,6 +10,7 @@
#include <QCoreApplication>
#include <QFileInfo>
#include <QStringList>
#include <QUrl>
#include <systemd/sd-journal.h>

#include "libssu/sandbox_p.h"
Expand Down Expand Up @@ -154,9 +155,14 @@ void SsuUrlResolver::run(){
ssuLog->print(LOG_DEBUG, QString("Skipping credential for %1 with scope %2").arg(repo).arg(credentialsScope));

if (!headerList.isEmpty() && !resolvedUrl.isEmpty()){
resolvedUrl = QString("%1?%2")
.arg(resolvedUrl)
.arg(headerList.join("&"));
QUrl url(resolvedUrl);

if (url.hasQuery()){
url.setQuery(url.query() + "&" + headerList.join("&"));
} else
url.setQuery(headerList.join("&"));

resolvedUrl = url.toString();
}

// TODO, we should bail out here if the configuration specifies that the repo
Expand Down

0 comments on commit 499014f

Please sign in to comment.