Commits

David Larlet  committed 10974b2 Merge

Merged in atodorov/django-storages/pass-headers-to-S3BotoConnection.generate_url (pull request #65)

Pass headers and response_headers S3BotoConnection.generate_url()

  • Participants
  • Parent commits 7b75212, 3cb6a9b

Comments (0)

Files changed (1)

File storages/backends/s3boto.py

         # Parse the last_modified string to a local datetime object.
         return parse_ts_extended(entry.last_modified)
 
-    def url(self, name):
+    def url(self, name, headers=None, response_headers=None):
         name = self._normalize_name(self._clean_name(name))
         if self.custom_domain:
             return "%s//%s/%s" % (self.url_protocol,
                                   self.custom_domain, name)
         return self.connection.generate_url(self.querystring_expire,
             method='GET', bucket=self.bucket.name, key=self._encode_name(name),
-            query_auth=self.querystring_auth, force_http=not self.secure_urls)
+            headers=headers,
+            query_auth=self.querystring_auth, force_http=not self.secure_urls,
+            response_headers=response_headers)
 
     def get_available_name(self, name):
         """ Overwrite existing file with the same name. """