зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
1f57ddfe70
Коммит
bc9eb3ea37
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче