Commit c12b880e authored by Gero Müller's avatar Gero Müller
Browse files

fix download of unknown mimetype, fixes #2214

parent 86ab8776
......@@ -67,6 +67,8 @@ class FSController(AbstractController):
mimetype = fs.get_mime_type(path)
if mimetype is not None:
headers['Content-Type'] = mimetype
else:
headers['Content-Type'] = "application/octet-stream"
self.release()
......
......@@ -3,7 +3,7 @@
# imports
from StringIO import StringIO
from distutils.spawn import find_executable
from mimetypes import guess_type
import mimetypes
from zipfile import ZipFile
from threading import Lock, Thread
from time import time
......@@ -85,6 +85,7 @@ class FileSystem(object):
self.watchservice = WatchService()
self._userid = userid
self._workspaceid = workspaceid
mimetypes.init()
def __del__(self):
self.close()
......@@ -108,7 +109,7 @@ class FileSystem(object):
def get_mime_type(self, filepath):
filepath = self.expand(filepath)
mime, encoding = guess_type(filepath)
mime, encoding = mimetypes.guess_type(filepath)
if mime is not None:
return mime
ext = filepath.split(".")[-1]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment