commit/galaxy-central: dan: Provide an error message when trying to directly view a directory in extra_files_path.
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/4618be57481b/ changeset: 4618be57481b branches: user: dan date: 2011-06-02 20:18:34 summary: Provide an error message when trying to directly view a directory in extra_files_path. affected #: 1 file (207 bytes) --- a/lib/galaxy/web/controllers/dataset.py Thu Jun 02 13:10:28 2011 -0400 +++ b/lib/galaxy/web/controllers/dataset.py Thu Jun 02 14:18:34 2011 -0400 @@ -348,17 +348,18 @@ # For files in extra_files_path file_path = os.path.join( data.extra_files_path, filename ) if os.path.exists( file_path ): + if os.path.isdir( file_path ): + return trans.show_error_message( "Directory listing is not allowed." ) #TODO: Reconsider allowing listing of directories? mime, encoding = mimetypes.guess_type( file_path ) if not mime: try: mime = trans.app.datatypes_registry.get_mimetype_by_extension( ".".split( file_path )[-1] ) except: mime = "text/plain" - trans.response.set_content_type( mime ) return open( file_path ) else: - return "Could not find '%s' on the extra files path %s." % (filename,file_path) + return trans.show_error_message( "Could not find '%s' on the extra files path %s." % ( filename, file_path ) ) mime = trans.app.datatypes_registry.get_mimetype_by_extension( data.extension.lower() ) trans.response.set_content_type(mime) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket