summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-07-06 21:32:44 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-07-06 21:51:01 +0300
commitf5385a80266e67bc8b2901e78ddfa886d8b61bbc (patch)
treef84d1027eab8dbcd99ba04d0dc4613c469e950f9 /indra
parent5928afda8a5db7875a9d4743fb04daf3c8c51be4 (diff)
SL-18164 Media type format not shown in the About Land's media tab
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterurlentry.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp
index 917d6dfcd0..48d6e01d32 100644
--- a/indra/newview/llfloaterurlentry.cpp
+++ b/indra/newview/llfloaterurlentry.cpp
@@ -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))