From 0bcfa74ea1e0eb57927bd1850feb9331489af6bc Mon Sep 17 00:00:00 2001 From: Daniel Blankenberg Date: Wed, 13 Jan 2016 16:28:59 -0500 Subject: [PATCH] Set mime type when previewing tabular data that has > 50 columns, but < 1000000 bytes. Fixes the issue of losing newlines and actual spacing (i.e. do not treat as html). --- lib/galaxy/datatypes/tabular.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/galaxy/datatypes/tabular.py b/lib/galaxy/datatypes/tabular.py index 3617ed5336a..c9161747af1 100644 --- a/lib/galaxy/datatypes/tabular.py +++ b/lib/galaxy/datatypes/tabular.py @@ -81,6 +81,7 @@ class TabularData( data.Text ): # For now, default to the old behavior, ugly as it is. Remove this after adding 'matrix'. max_peek_size = 1000000 # 1 MB if os.stat( dataset.file_name ).st_size < max_peek_size: + self._clean_and_set_mime_type( trans, dataset.get_mime() ) return open( dataset.file_name ) else: trans.response.set_content_type( "text/html" )