mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 02:04:04 +08:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user