Set a catchall content-type (application/octet-stream) on metadata file downloads so Safari doesn't consider them to be html.

This commit is contained in:
Nate Coraor
2011-06-01 16:27:28 -04:00
parent 7c5e57f774
commit b91ca79851
+1
View File
@@ -316,6 +316,7 @@ class DatasetInterface( BaseController, UsesAnnotations, UsesHistory, UsesHistor
valid_chars = '.,^_-()[]0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
fname = ''.join(c in valid_chars and c or '_' for c in data.name)[0:150]
trans.response.headers["Content-Type"] = "application/octet-stream"
trans.response.headers["Content-Disposition"] = "attachment; filename=Galaxy%s-[%s].%s" % (data.hid, fname, metadata_type)
return open(data.metadata.get(metadata_type).file_name)