details: http://www.bx.psu.edu/hg/galaxy/rev/e52685283a90 changeset: 3190:e52685283a90 user: Kanwei Li <kanwei@gmail.com> date: Mon Dec 21 17:20:46 2009 -0500 description: Escape preview data diffstat: lib/galaxy/web/controllers/dataset.py | 3 ++- templates/dataset/large_file.mako | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diffs (30 lines): diff -r 89d265617353 -r e52685283a90 lib/galaxy/web/controllers/dataset.py --- a/lib/galaxy/web/controllers/dataset.py Mon Dec 21 12:16:21 2009 -0500 +++ b/lib/galaxy/web/controllers/dataset.py Mon Dec 21 17:20:46 2009 -0500 @@ -198,6 +198,7 @@ return trans.show_error_message( "Please wait until this dataset finishes uploading before attempting to view it." ) if filename and filename != "index": + # For files in extra_files_path file_path = os.path.join( data.extra_files_path, filename ) if os.path.exists( file_path ): mime, encoding = mimetypes.guess_type( file_path ) @@ -205,7 +206,7 @@ try: mime = trans.app.datatypes_registry.get_mimetype_by_extension( ".".split( file_path )[-1] ) except: - mime = "txt" + mime = "text/plain" trans.response.set_content_type( mime ) return open( file_path ) diff -r 89d265617353 -r e52685283a90 templates/dataset/large_file.mako --- a/templates/dataset/large_file.mako Mon Dec 21 12:16:21 2009 -0500 +++ b/templates/dataset/large_file.mako Mon Dec 21 17:20:46 2009 -0500 @@ -7,5 +7,5 @@ </div> <pre> -${ truncated_data } +${ truncated_data | h } </pre>