From edb4b79e1b91ef1890cfe166c190032e4124ba08 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 30 Sep 2020 14:45:28 -0400 Subject: [PATCH] Make the scheme and path prefix optional --- vendor/DOtherSide/lib/src/DOtherSide.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vendor/DOtherSide/lib/src/DOtherSide.cpp b/vendor/DOtherSide/lib/src/DOtherSide.cpp index 12c2fe8511..5d8967e08f 100644 --- a/vendor/DOtherSide/lib/src/DOtherSide.cpp +++ b/vendor/DOtherSide/lib/src/DOtherSide.cpp @@ -1162,8 +1162,16 @@ char *dos_qurl_host(char* url) char *dos_qurl_replaceHostAndAddPath(char* url, char* newScheme, char* newHost, char* pathPrefix) { auto newQurl = QUrl(QString(url)); - newQurl.setScheme(newScheme); + newQurl.setHost(newHost); - newQurl.setPath(QString(pathPrefix) + newQurl.path()); + + if(QString(newScheme).compare("") != 0){ + newQurl.setScheme(newScheme); + } + + if (QString(pathPrefix).compare("") != 0){ + newQurl.setPath(QString(pathPrefix) + newQurl.path()); + } + return convert_to_cstring(newQurl.toString()); }