diff --git a/ckan/controllers/storage.py b/ckan/controllers/storage.py index cfee8bd3d78..e52b68a18f9 100644 --- a/ckan/controllers/storage.py +++ b/ckan/controllers/storage.py @@ -262,8 +262,9 @@ 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,