Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6312)

Unified Diff: chrome/browser/download/download_manager.cc

Issue 42622: Add an exception to DownloadManager::GenerateExtension() for .tar.gz files wi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_manager.cc
===================================================================
--- chrome/browser/download/download_manager.cc (revision 12475)
+++ chrome/browser/download/download_manager.cc (working copy)
@@ -1142,11 +1142,15 @@
// an executable is hidden in a benign file extension;
// E.g. my-cat.jpg becomes my-cat.jpg.js if content type is
// application/x-javascript.
+ // 4. New extension is not ".tar" for .gz files. For misconfigured web
+ // servers, i.e. bug 5772.
FilePath::StringType append_extension;
if (net::GetPreferredExtensionForMimeType(mime_type, &append_extension)) {
if (append_extension != FILE_PATH_LITERAL("txt") &&
append_extension != extension &&
- !IsExecutable(append_extension)) {
+ !IsExecutable(append_extension) &&
+ (append_extension != FILE_PATH_LITERAL("tar") ||
+ extension != FILE_PATH_LITERAL("gz"))) {
extension += FILE_PATH_LITERAL(".");
extension += append_extension;
}

Powered by Google App Engine
This is Rietveld 408576698