Chromium Code Reviews| Index: chrome/browser/extensions/api/file_handlers/mime_util.cc |
| diff --git a/chrome/browser/extensions/api/file_handlers/mime_util.cc b/chrome/browser/extensions/api/file_handlers/mime_util.cc |
| index 74b622c26bdf7ec03b792d0d409553995be20d29..44198112627cb1180427c8150d86d8414de3fb08 100644 |
| --- a/chrome/browser/extensions/api/file_handlers/mime_util.cc |
| +++ b/chrome/browser/extensions/api/file_handlers/mime_util.cc |
| @@ -37,6 +37,12 @@ void SniffMimeType(const base::FilePath& local_path, std::string* result) { |
| net::FilePathToFileURL(local_path), |
| std::string(), // type_hint (passes no hint) |
| result); |
| + |
| + // If the extension is not .zip, do not handle the file as application/zip |
| + // since it might be unknown internally zipped file. |
| + if (*result == "application/zip" && |
| + local_path.Extension() != FILE_PATH_LITERAL(".zip")) |
|
benwells
2015/04/14 21:57:22
The logic of this flow is, I think:
- return the m
yawano
2015/04/15 03:41:34
Moving to OnSniffMimeTypeForNativeLocalPathComplet
|
| + result->assign("application/octet-stream"); |
|
benwells
2015/04/14 21:57:22
Why is the default application/octet-stream? Is th
yawano
2015/04/15 03:41:34
I think there is no default mime type. The default
|
| } |
| } |