diff --git a/src/api/webDAV.cpp b/src/api/webDAV.cpp index c77336d..2af98b7 100644 --- a/src/api/webDAV.cpp +++ b/src/api/webDAV.cpp @@ -30,12 +30,16 @@ namespace fs = std::experimental::filesystem; std::string WebDAV::getRootPath(bool encode) { string rootPath = Util::getConfig("ex_relativeRootPath", "/"); - if (rootPath == "") + if (rootPath.empty()) + { rootPath += "/"; + } string user = Util::getConfig("UUID", ""); - if (user == "") + if (user.empty()) + { user = Util::getConfig("username", "error"); + } string rtc = NEXTCLOUD_ROOT_PATH + user + rootPath; @@ -79,6 +83,7 @@ std::vector WebDAV::login(const string &Url, const string &Username, _url = Url; uuid = Username; } + Util::encodeUrl(uuid); auto tempPath = NEXTCLOUD_ROOT_PATH + uuid + "/"; Util::writeConfig("storageLocation", "/mnt/ext1/nextcloud"); std::vector tempItems = getDataStructure(tempPath);