Treat an empty disposition string the same as it not being set. Bug 272541,

r=biesi, sr=darin
This commit is contained in:
bzbarsky%mit.edu 2004-12-04 17:46:49 +00:00
Родитель 7e163d00c8
Коммит 0c1dfb26c6
2 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -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.