Merge with develop

--HG--
branch : yubo
hg/yubo
Nimetu 6 years ago
commit a4b3e57fd0

@ -3829,6 +3829,9 @@ namespace NLGUI
return;
}
// received content from remote
std::string content = trim(_CurlWWW->Content);
// save HSTS header from all requests regardless of HTTP code
if (_CurlWWW->hasHSTSHeader())
{
@ -3870,8 +3873,11 @@ namespace NLGUI
else if ( (code < 200 || code >= 300) )
{
// catches 304 not modified, but html is not in cache anyway
browseError(string("Connection failed\nhttp code " + toString((sint32)code) + ")\nURL '" + _CurlWWW->Url + "'").c_str());
return;
// if server did not send any error back
if (content.empty())
{
content = string("<html><head><title>ERROR</title></head><body><h1>Connection failed</h1><p>HTTP code '" + toString((sint32)code) + "'</p><p>URL '" + _CurlWWW->Url + "'</p></body></html>");
}
}
char *ch;
@ -3882,7 +3888,7 @@ namespace NLGUI
contentType = ch;
}
htmlDownloadFinished(_CurlWWW->Content, contentType, code);
htmlDownloadFinished(content, contentType, code);
// clear curl handler
if (MultiCurl)

Loading…
Cancel
Save