Permalink
Browse files

Add support for putting arbitrary additional headers in s3cfg file.

  • Loading branch information...
1 parent 0151fa4 commit 50a423335a55c4e8bf1adf364bf298c85443c170 @relistan committed Apr 1, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 S3/Config.py
View
@@ -83,6 +83,7 @@ class Config(object):
website_index = "index.html"
website_error = ""
website_endpoint = "http://%(bucket)s.s3-website-%(location)s.amazonaws.com/"
+ add_headers = ""
## Creating a singleton
def __new__(self, configfile = None):
@@ -112,6 +113,12 @@ def read_config_file(self, configfile):
cp = ConfigParser(configfile)
for option in self.option_list():
self.update_option(option, cp.get(option))
+
+ if cp.get('add_headers'):
+ for option in cp.get('add_headers').split(","):
+ (key, value) = option.split(':')
+ self.extra_headers[key.replace('_', '-').strip()] = value.strip()
+
self._parsed_files.append(configfile)
def dump_config(self, stream):

0 comments on commit 50a4233

Please sign in to comment.