bug 209513 : be generous to broken servers emiitng 'filename=...' without

specifying the dispositin type spec in Content-Disposition header.
(r/sr=bzbarsky)
This commit is contained in:
jshin%mailaps.org 2003-06-18 09:07:58 +00:00
Родитель 1f57ddfe70
Коммит bc9eb3ea37
2 изменённых файлов: 6 добавлений и 4 удалений

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

@ -312,11 +312,12 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports *
PR_FALSE, nsnull, dispToken);
// RFC 2183, section 2.8 says that an unknown disposition
// value should be treated as "attachment"
if (NS_FAILED(rv) || !dispToken.EqualsIgnoreCase("inline") &&
if (NS_FAILED(rv) ||
(!dispToken.EqualsIgnoreCase("inline") &&
// Broken sites just send
// Content-Disposition: filename="file"
// without a disposition token... screen those out.
!dispToken.EqualsIgnoreCase("filename"))
!dispToken.EqualsIgnoreCase("filename", 8)))
// We have a content-disposition of "attachment" or unknown
forceExternalHandling = PR_TRUE;
}

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

@ -1002,11 +1002,12 @@ void nsExternalAppHandler::ExtractSuggestedFileNameFromChannel(nsIChannel* aChan
nsnull, dispToken);
// RFC 2183, section 2.8 says that an unknown disposition
// value should be treated as "attachment"
if (NS_FAILED(rv) || !dispToken.EqualsIgnoreCase("inline") &&
if (NS_FAILED(rv) ||
(!dispToken.EqualsIgnoreCase("inline") &&
// Broken sites just send
// Content-Disposition: filename="file"
// without a disposition token... screen those out.
!dispToken.EqualsIgnoreCase("filename"))
!dispToken.EqualsIgnoreCase("filename", 8)))
{
// We have a content-disposition of "attachment" or unknown
mHandlingAttachment = PR_TRUE;