зеркало из https://github.com/mozilla/pjs.git
Treat an empty disposition string the same as it not being set. Bug 272541,
r=biesi, sr=darin
This commit is contained in:
Родитель
7e163d00c8
Коммит
0c1dfb26c6
|
@ -426,8 +426,14 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports *
|
|||
PR_TRUE, nsnull, dispToken);
|
||||
// RFC 2183, section 2.8 says that an unknown disposition
|
||||
// value should be treated as "attachment"
|
||||
// XXXbz this code is duplicated in GetFilenameAndExtensionFromChannel in
|
||||
// nsExternalHelperAppService. Factor it out!
|
||||
if (NS_FAILED(rv) ||
|
||||
(!dispToken.LowerCaseEqualsLiteral("inline") &&
|
||||
(// Some broken sites just send
|
||||
// Content-Disposition: ; filename="file"
|
||||
// screen those out here.
|
||||
!dispToken.IsEmpty() &&
|
||||
!dispToken.LowerCaseEqualsLiteral("inline") &&
|
||||
// Broken sites just send
|
||||
// Content-Disposition: filename="file"
|
||||
// without a disposition token... screen those out.
|
||||
|
|
|
@ -286,8 +286,14 @@ static PRBool GetFilenameAndExtensionFromChannel(nsIChannel* aChannel,
|
|||
nsnull, dispToken);
|
||||
// RFC 2183, section 2.8 says that an unknown disposition
|
||||
// value should be treated as "attachment"
|
||||
// XXXbz this code is duplicated in nsDocumentOpenInfo::DispatchContent.
|
||||
// Factor it out! Maybe store it in the nsDocumentOpenInfo?
|
||||
if (NS_FAILED(rv) ||
|
||||
(!dispToken.LowerCaseEqualsLiteral("inline") &&
|
||||
(// Some broken sites just send
|
||||
// Content-Disposition: ; filename="file"
|
||||
// screen those out here.
|
||||
!dispToken.IsEmpty() &&
|
||||
!dispToken.LowerCaseEqualsLiteral("inline") &&
|
||||
// Broken sites just send
|
||||
// Content-Disposition: filename="file"
|
||||
// without a disposition token... screen those out.
|
||||
|
|
Загрузка…
Ссылка в новой задаче