summaryrefslogtreecommitdiffstats
path: root/uriloader/base
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /uriloader/base
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'uriloader/base')
-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"));