diff --git a/source/remotefs/HTTPDir/HTTPDir.cpp b/source/remotefs/HTTPDir/HTTPDir.cpp index ad43e6d..d2228c2 100644 --- a/source/remotefs/HTTPDir/HTTPDir.cpp +++ b/source/remotefs/HTTPDir/HTTPDir.cpp @@ -60,6 +60,12 @@ void HTTPDir::DirList(std::string path,const std::vector &extension currentlist.clear(); urlschema thisurl = Utility::parseUrl(url); std::string geturl = thisurl.scheme + std::string("://") + thisurl.server + (thisurl.port.empty() ? std::string() : ':' + thisurl.port) + std::string("/") + path; + if (thisurl.user != NULL && thisurl.pass != NULL){ + std::string geturl = thisurl.scheme + std::string("://") + thisurl.user + ":" + thisurl.pass + "@" + thisurl.server + (thisurl.port.empty() ? std::string() : ':' + thisurl.port) + std::string("/") + path; + } + else if (thisurl.user != NULL){ + std::string geturl = thisurl.scheme + std::string("://") + thisurl.user + "@" + thisurl.server + (thisurl.port.empty() ? std::string() : ':' + thisurl.port) + std::string("/") + path; + } HTTPMemoryStruct *chunk = (HTTPMemoryStruct *)malloc(sizeof(HTTPMemoryStruct)); curlDownload((char *)geturl.c_str(),chunk); std::string s = chunk->memory;