diff --git a/ckan/controllers/storage.py b/ckan/controllers/storage.py index 85de36750ae..be287d1c683 100644 --- a/ckan/controllers/storage.py +++ b/ckan/controllers/storage.py @@ -262,7 +262,10 @@ def get_metadata(self, label): if storage_backend in ['google', 's3']: if not label.startswith("/"): label = "/" + label - url = "https://%s/%s%s" % (self.ofs.conn.server_name(), bucket, label) + url = "https://%s%s" % ( + self.ofs.conn.calling_format.build_host( + self.ofs.conn.server_name(), bucket), label) + else: url = h.url_for('storage_file', label=label,