mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
Moving closing paren to make it clearer what the logic really is and removing redundant comment. No behavior change.
This commit is contained in:
parent
d3fc632669
commit
c684aeb137
@ -161,17 +161,14 @@ HasAttachmentDisposition(nsIHttpChannel* httpChannel)
|
||||
// XXXbz this code is duplicated in GetFilenameAndExtensionFromChannel in
|
||||
// nsExternalHelperAppService. Factor it out!
|
||||
if (NS_FAILED(rv) ||
|
||||
(// Some broken sites just send
|
||||
// Content-Disposition: ; filename="file"
|
||||
// screen those out here.
|
||||
!dispToken.IsEmpty() &&
|
||||
(!dispToken.IsEmpty() &&
|
||||
!StringBeginsWithLowercaseLiteral(dispToken, "inline") &&
|
||||
// Broken sites just send
|
||||
// Content-Disposition: filename="file"
|
||||
// without a disposition token... screen those out.
|
||||
!StringBeginsWithLowercaseLiteral(dispToken, "filename")) &&
|
||||
!StringBeginsWithLowercaseLiteral(dispToken, "filename") &&
|
||||
// Also in use is Content-Disposition: name="file"
|
||||
!StringBeginsWithLowercaseLiteral(dispToken, "name"))
|
||||
!StringBeginsWithLowercaseLiteral(dispToken, "name")))
|
||||
// We have a content-disposition of "attachment" or unknown
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
@ -402,17 +402,14 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports *
|
||||
// XXXbz this code is duplicated in GetFilenameAndExtensionFromChannel in
|
||||
// nsExternalHelperAppService. Factor it out!
|
||||
if (NS_FAILED(rv) ||
|
||||
(// Some broken sites just send
|
||||
// Content-Disposition: ; filename="file"
|
||||
// screen those out here.
|
||||
!dispToken.IsEmpty() &&
|
||||
(!dispToken.IsEmpty() &&
|
||||
!dispToken.LowerCaseEqualsLiteral("inline") &&
|
||||
// Broken sites just send
|
||||
// Content-Disposition: filename="file"
|
||||
// without a disposition token... screen those out.
|
||||
!dispToken.EqualsIgnoreCase("filename", 8)) &&
|
||||
!dispToken.EqualsIgnoreCase("filename", 8) &&
|
||||
// Also in use is Content-Disposition: name="file"
|
||||
!dispToken.EqualsIgnoreCase("name", 4))
|
||||
!dispToken.EqualsIgnoreCase("name", 4)))
|
||||
// We have a content-disposition of "attachment" or unknown
|
||||
forceExternalHandling = PR_TRUE;
|
||||
}
|
||||
|
@ -316,17 +316,14 @@ static PRBool GetFilenameAndExtensionFromChannel(nsIChannel* aChannel,
|
||||
// XXXbz this code is duplicated in nsDocumentOpenInfo::DispatchContent.
|
||||
// Factor it out! Maybe store it in the nsDocumentOpenInfo?
|
||||
if (NS_FAILED(rv) ||
|
||||
(// Some broken sites just send
|
||||
// Content-Disposition: ; filename="file"
|
||||
// screen those out here.
|
||||
!dispToken.IsEmpty() &&
|
||||
(!dispToken.IsEmpty() &&
|
||||
!dispToken.LowerCaseEqualsLiteral("inline") &&
|
||||
// Broken sites just send
|
||||
// Content-Disposition: filename="file"
|
||||
// without a disposition token... screen those out.
|
||||
!dispToken.EqualsIgnoreCase("filename", 8)) &&
|
||||
!dispToken.EqualsIgnoreCase("filename", 8) &&
|
||||
// Also in use is Content-Disposition: name="file"
|
||||
!dispToken.EqualsIgnoreCase("name", 4))
|
||||
!dispToken.EqualsIgnoreCase("name", 4)))
|
||||
{
|
||||
// We have a content-disposition of "attachment" or unknown
|
||||
handleExternally = PR_TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user