diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-09-10 23:26:13 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-09-11 15:23:09 +0300 |
| commit | c3c45e00abd8b10679d911e1b92d2acb91aaf209 (patch) | |
| tree | 0bce80527061bc07f2c07e8bbd82530ee922e2a1 /indra/newview/llfloaterurlentry.cpp | |
| parent | cf75c9c95867790b6199dc16da206a98fe4423d5 (diff) | |
#1825 Use html as a default type for nosniff mime probes
Diffstat (limited to 'indra/newview/llfloaterurlentry.cpp')
| -rw-r--r-- | indra/newview/llfloaterurlentry.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 7651b2528f..2f1857ec61 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -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); |
