fix tools

This commit is contained in:
ilvalle
2016-06-13 20:20:44 +02:00
parent a18e0e489f
commit 7259516627
8 changed files with 78 additions and 77 deletions
+2 -1
View File
@@ -19,6 +19,7 @@ Additions:
- .pickle: application/python-pickle
- .w2p': application/w2p
"""
from gluon._compat import to_native
__all__ = ['contenttype']
@@ -842,7 +843,7 @@ def contenttype(filename, default='text/plain'):
"""
Returns the Content-Type string matching extension of the given filename.
"""
filename=to_native(filename)
i = filename.rfind('.')
if i >= 0:
default = CONTENT_TYPE.get(filename[i:].lower(), default)