Browse code

MIME-Type guessing is now on by default

Michal Ludvig authored on 2012/01/05 21:56:00
Showing 3 changed files
... ...
@@ -5,7 +5,7 @@ s3cmd 1.1.0   -   ???
5 5
 * Added "Static WebSite" support [ws-create / ws-delete / ws-info]
6 6
   (contributed by Jens Braeuer)
7 7
 * Force MIME type with --mime-type=abc/xyz, also --guess-mime-type 
8
-  is no longer on by default.
8
+  is now on by default, -M is no longer shorthand for --guess-mime-type
9 9
 * Allow parameters in MIME types, for example:
10 10
   --mime-type="text/plain; charset=utf-8"
11 11
 * Support for environment variables as config values. For instance
... ...
@@ -61,7 +61,7 @@ class Config(object):
61 61
     use_https = False
62 62
     bucket_location = "US"
63 63
     default_mime_type = "binary/octet-stream"
64
-    guess_mime_type = False
64
+    guess_mime_type = True
65 65
     mime_type = ""
66 66
     # List of checks to be performed for 'sync'
67 67
     sync_checks = ['size', 'md5']   # 'weak-timestamp'
... ...
@@ -1517,7 +1517,7 @@ def main():
1517 1517
     optparser.add_option(      "--no-access-logging", dest="log_target_prefix", action="store_false", help="Disable access logging (for [cfmodify] and [accesslog] commands)")
1518 1518
 
1519 1519
     optparser.add_option(      "--default-mime-type", dest="default_mime_type", action="store_true", help="Default MIME-type for stored objects. Application default is binary/octet-stream.")
1520
-    optparser.add_option("-M", "--guess-mime-type", dest="guess_mime_type", action="store_true", help="Guess MIME-type of files by their extension. Fall back to default MIME-Type as specified by --default-mime-type option")
1520
+    optparser.add_option(      "--guess-mime-type", dest="guess_mime_type", action="store_true", help="Guess MIME-type of files by their extension or mime magic. Fall back to default MIME-Type as specified by --default-mime-type option")
1521 1521
     optparser.add_option(      "--no-guess-mime-type", dest="guess_mime_type", action="store_false", help="Don't guess MIME-type and use the default type instead.")
1522 1522
     optparser.add_option("-m", "--mime-type", dest="mime_type", type="mimetype", metavar="MIME/TYPE", help="Force MIME-type. Override both --default-mime-type and --guess-mime-type.")
1523 1523