From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- uriloader/base/nsURILoader.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'uriloader/base') 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")); -- cgit v1.2.3