David Larlet avatar 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()

Comments (0)

Files changed (1)


         # 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. """
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.