Commits

James O'Donnell  committed 1143c1e Draft

dirty hack to get the trailing slash to stay when used on heroku

  • Participants
  • Parent commits 006daa3

Comments (0)

Files changed (1)

File storages/backends/s3boto.py

         if self.custom_domain:
             return "%s://%s/%s" % ('https' if self.secure_urls else 'http',
                                    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)
+        url = 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)
+        if name.endswith('/') and not url.endswith('/'):
+            url += '/'
+        return url
 
     def get_available_name(self, name):
         """ Overwrite existing file with the same name. """