diff options
Diffstat (limited to 'indra/newview/llfloaterurlentry.cpp')
| -rw-r--r-- | indra/newview/llfloaterurlentry.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 7651b2528f..9696c3d3f8 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -201,10 +201,10 @@ void LLFloaterURLEntry::getMediaTypeCoro(std::string url, LLHandle<LLFloater> pa { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); 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); + httpAdapter = std::make_shared<LLCoreHttpUtil::HttpCoroutineAdapter>("getMediaTypeCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared<LLCore::HttpRequest>(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared<LLCore::HttpHeaders>(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared<LLCore::HttpOptions>(); httpOpts->setFollowRedirects(true); httpOpts->setHeadersOnly(true); @@ -242,6 +242,16 @@ void LLFloaterURLEntry::getMediaTypeCoro(std::string url, LLHandle<LLFloater> pa resolvedMimeType = mimeType; } } + else if (resultHeaders.has(HTTP_IN_HEADER_X_CONTENT_TYPE_OPTIONS)) + { + const std::string& val = resultHeaders[HTTP_IN_HEADER_X_CONTENT_TYPE_OPTIONS]; + if (val == HTTP_NOSNIFF) + { + // Doesn't permit 'sniffing' mime type, default to either html or plain + // If this doesn't work user will have to choose something manually. + resolvedMimeType = HTTP_CONTENT_TEXT_HTML; + } + } floaterUrlEntry->headerFetchComplete(status.getType(), resolvedMimeType); |
