Skip to content

Commit

Permalink
Allow optional parameters in --mime-type
Browse files Browse the repository at this point in the history
For example to upload UTF-8 encoded html file use:
	--mime-type="text/html; charset=utf-8"
  • Loading branch information
mludvig committed Dec 30, 2011
1 parent 777acd9 commit 615eed4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion s3cmd
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ def format_commands(progname, commands_list):

class OptionMimeType(Option):
def check_mimetype(option, opt, value):
if re.compile("^[a-z0-9]+/[a-z0-9+\.-]+$", re.IGNORECASE).match(value):
if re.compile("^[a-z0-9]+/[a-z0-9+\.-]+(;.*)?$", re.IGNORECASE).match(value):
return value
raise OptionValueError("option %s: invalid MIME-Type format: %r" % (opt, value))

Expand Down

0 comments on commit 615eed4

Please sign in to comment.