Merge pull request #1498 from blankenberg/tab_mime

[16.01] Set mime type when previewing tabular data that has > 50 columns, but < 1000000 bytes.
This commit is contained in:
John Chilton
2016-01-14 04:12:27 -05:00
+1
View File
@@ -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" )