From 4f0717c58a600e94d925178efb52a1cab3f71447 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 4 May 2017 10:26:22 +0300 Subject: [PATCH] Fixed: Image cookies --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 1f3d6d6c7..79dfa77f1 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -376,7 +376,9 @@ namespace NLGUI std::string userAgent = options.appName + "/" + options.appVersion; curl_easy_setopt(curl, CURLOPT_USERAGENT, userAgent.c_str()); - sendCookies(curl, _DocumentDomain, _TrustedDomain); + CUrlParser uri(download.url); + if (!uri.host.empty()) + sendCookies(curl, uri.host, isTrustedDomain(uri.host)); curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite); @@ -638,7 +640,9 @@ namespace NLGUI curl_easy_getinfo(it->data->Request, CURLINFO_RESPONSE_CODE, &r); fclose(it->fp); - receiveCookies(it->data->Request, _DocumentDomain, _TrustedDomain); + CUrlParser uri(it->url); + if (!uri.host.empty()) + receiveCookies(it->data->Request, uri.host, isTrustedDomain(uri.host)); #ifdef LOG_DL nlwarning("(%s) transfer '%p' completed with status %d, http %d, url (len %d) '%s'", _Id.c_str(), it->data->Request, res, r, it->url.size(), it->url.c_str()); #endif