summaryrefslogtreecommitdiffstats
path: root/uriloader/base/nsURILoader.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /uriloader/base/nsURILoader.cpp
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'uriloader/base/nsURILoader.cpp')
-rw-r--r--uriloader/base/nsURILoader.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp
index 0acd451c9d..792f3ea893 100644
--- a/uriloader/base/nsURILoader.cpp
+++ b/uriloader/base/nsURILoader.cpp
@@ -274,12 +274,19 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest* request) {
// could happen because the Content-Disposition header is set so, or, in the
// future, because the user has specified external handling for the MIME
// type.
+ //
+ // If we're not going to be able to retarget to an external handler, ignore
+ // content-disposition, and unconditionally try to display the content.
+ // This is used for object/embed tags, which expect to display subresources
+ // marked with an attachment disposition.
bool forceExternalHandling = false;
- uint32_t disposition;
- rv = aChannel->GetContentDisposition(&disposition);
+ if (!(mFlags & nsIURILoader::DONT_RETARGET)) {
+ uint32_t disposition;
+ rv = aChannel->GetContentDisposition(&disposition);
- if (NS_SUCCEEDED(rv) && disposition == nsIChannel::DISPOSITION_ATTACHMENT) {
- forceExternalHandling = true;
+ if (NS_SUCCEEDED(rv) && disposition == nsIChannel::DISPOSITION_ATTACHMENT) {
+ forceExternalHandling = true;
+ }
}
LOG((" forceExternalHandling: %s", forceExternalHandling ? "yes" : "no"));