adding in to the whitelist (bug 651800)
This commit is contained in:
Родитель
0cdc333bd6
Коммит
36996d7956
|
@ -73,10 +73,13 @@ class FileViewer:
|
|||
major, minor = mimetype.split('/')
|
||||
if major == 'text' and minor in ['plain', 'html', 'css']:
|
||||
return False
|
||||
elif minor in ['xml', 'rdf+xml', 'javascript', 'x-javascript',
|
||||
'xml-dtd', 'vnd.mozilla.xul+xml']:
|
||||
elif major == 'application' and minor in ['json']:
|
||||
return False
|
||||
elif os.path.splitext(filename)[1] in ['.dtd', '.xul', '.properties']:
|
||||
elif minor in ['xml', 'rdf+xml', 'javascript', 'x-javascript',
|
||||
'xml-dtd', 'vnd.mozilla.xul+xml']:
|
||||
return False
|
||||
elif os.path.splitext(filename)[1] in ['.dtd', '.xul', '.properties',
|
||||
'.src', '.mf', '.sf', '.json']:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class TestFileHelper(test_utils.TestCase):
|
|||
binary = self.viewer.is_binary
|
||||
for f in ['foo.rdf', 'foo.xml', 'foo.js', 'foo.py'
|
||||
'foo.html', 'foo.txt', 'foo.dtd', 'foo.xul',
|
||||
'foo.properties']:
|
||||
'foo.properties', 'foo.json']:
|
||||
m, encoding = mimetypes.guess_type(f)
|
||||
assert not binary(m, f), '%s should not be binary' % f
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче