mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-28 03:17:31 +09:00
Issue #2648 - Inherit the content disposition of the multipart response
This commit is contained in:
parent
6fe326c7bb
commit
5c0c0c02d9
2 changed files with 13 additions and 1 deletions
|
|
@ -722,6 +722,12 @@ nsMultiMixedConv::OnStartRequest(nsIRequest *request, nsISupports *ctxt) {
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
mRootContentSecurityPolicy = csp;
|
||||
}
|
||||
nsCString contentDisposition;
|
||||
rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("content-disposition"),
|
||||
contentDisposition);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mRootContentDisposition = contentDisposition;
|
||||
}
|
||||
} else {
|
||||
// try asking the channel directly
|
||||
rv = channel->GetContentType(delimiter);
|
||||
|
|
@ -882,7 +888,12 @@ nsMultiMixedConv::SendStart(nsIChannel *aChannel) {
|
|||
rv = mPartChannel->SetContentLength(mContentLength);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Adopt content-disposition from the root doc, if present.
|
||||
if (!mRootContentDisposition.IsEmpty()) {
|
||||
mPartChannel->SetContentDisposition(mRootContentDisposition);
|
||||
} else {
|
||||
mPartChannel->SetContentDisposition(mContentDisposition);
|
||||
}
|
||||
|
||||
nsLoadFlags loadFlags = 0;
|
||||
mPartChannel->GetLoadFlags(&loadFlags);
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ protected:
|
|||
nsCString mContentDisposition;
|
||||
nsCString mContentSecurityPolicy;
|
||||
nsCString mRootContentSecurityPolicy;
|
||||
nsCString mRootContentDisposition;
|
||||
uint64_t mContentLength;
|
||||
|
||||
char *mBuffer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue