summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-27 21:24:39 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-27 21:24:39 +0000
commit3432291b5b66e9bea09537c3bfbc4d80f27442a4 (patch)
tree26b6a4c09bcebc35931e1f92abbfbacabea2fa13 /net/base
parent87351794d9614198c266f7380c38a7327eb50056 (diff)
downloadchromium_src-3432291b5b66e9bea09537c3bfbc4d80f27442a4.zip
chromium_src-3432291b5b66e9bea09537c3bfbc4d80f27442a4.tar.gz
chromium_src-3432291b5b66e9bea09537c3bfbc4d80f27442a4.tar.bz2
Treat multiple extensions like .tar.gz as a single extension.
The logic is taken from firefox. BUG=48346 TEST=unit tests; downloading the same .tar.gz file multiple times (see bug) Review URL: http://codereview.chromium.org/3018011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/filter.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/base/filter.cc b/net/base/filter.cc
index c72e00e..5e47ecb 100644
--- a/net/base/filter.cc
+++ b/net/base/filter.cc
@@ -108,17 +108,17 @@ void Filter::FixupEncodingTypes(
// When viewing a .svgz file, we need to uncompress it, but we don't
// want to do that when downloading.
// See Firefox's nonDecodableExtensions in nsExternalHelperAppService.cpp
- if (FILE_PATH_LITERAL(".gz" == extension) ||
- FILE_PATH_LITERAL(".tgz" == extension) ||
- FILE_PATH_LITERAL(".svgz") == extension)
+ if (EndsWith(extension, FILE_PATH_LITERAL(".gz"), false) ||
+ LowerCaseEqualsASCII(extension, ".tgz") ||
+ LowerCaseEqualsASCII(extension, ".svgz"))
encoding_types->clear();
} else {
// When the user does not explicitly ask to download a file, if we get a
// supported mime type, then we attempt to decompress in order to view it.
// However, if it's not a supported mime type, then we will attempt to
// download it, and in that case, don't decompress .gz/.tgz files.
- if ((FILE_PATH_LITERAL(".gz" == extension) ||
- FILE_PATH_LITERAL(".tgz") == extension) &&
+ if ((EndsWith(extension, FILE_PATH_LITERAL(".gz"), false) ||
+ LowerCaseEqualsASCII(extension, ".tgz")) &&
!net::IsSupportedMimeType(mime_type))
encoding_types->clear();
}