Skip to content
Snippets Groups Projects
Commit f5385a80 authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

SL-18164 Media type format not shown in the About Land's media tab

parent 5928afda
No related branches found
No related tags found
No related merge requests found
......@@ -175,10 +175,9 @@ void LLFloaterURLEntry::onBtnOK( void* userdata )
// We assume that an empty scheme is an http url, as this is how we will treat it.
if(scheme == "")
{
scheme = "http";
scheme = "https";
}
// Discover the MIME type only for "http" scheme.
if(!media_url.empty() &&
(scheme == "http" || scheme == "https"))
{
......@@ -204,13 +203,18 @@ void LLFloaterURLEntry::getMediaTypeCoro(std::string url, LLHandle<LLFloater> pa
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMediaTypeCoro", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders);
LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
httpOpts->setFollowRedirects(true);
httpOpts->setHeadersOnly(true);
httpHeaders->append(HTTP_OUT_HEADER_ACCEPT, "*/*");
httpHeaders->append(HTTP_OUT_HEADER_COOKIE, "");
LL_INFOS("HttpCoroutineAdapter", "genericPostCoro") << "Generic POST for " << url << LL_ENDL;
LLSD result = httpAdapter->getAndSuspend(httpRequest, url, httpOpts);
LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts, httpHeaders);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
......@@ -226,12 +230,6 @@ void LLFloaterURLEntry::getMediaTypeCoro(std::string url, LLHandle<LLFloater> pa
// which have no mime type set.
std::string resolvedMimeType = LLMIMETypes::getDefaultMimeType();
if (!status)
{
floaterUrlEntry->headerFetchComplete(status.getType(), resolvedMimeType);
return;
}
LLSD resultHeaders = httpResults[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS];
if (resultHeaders.has(HTTP_IN_HEADER_CONTENT_TYPE))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment