mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
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:
parent
1f57ddfe70
commit
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;
|
||||
|
Loading…
Reference in New Issue
Block a user