[web/views/staticcontroller] safety belt for unguessed mimetypes (closes #2380304)
--- a/sobjects/ldapparser.py Thu May 24 14:01:05 2012 +0200
+++ b/sobjects/ldapparser.py Fri May 25 16:19:21 2012 +0200
@@ -39,8 +39,10 @@
"""IDataFeedParser main entry point"""
source = self.source
searchstr = '(&%s)' % ''.join(source.base_filters)
+ self.warning('processing ldapfeed stuff %s %s', source, searchstr)
for userdict in source._search(self._cw, source.user_base_dn,
source.user_base_scope, searchstr):
+ self.warning('fetched user %s', userdict)
entity = self.extid2entity(userdict['dn'], 'CWUser', **userdict)
if entity is not None and not self.created_during_pull(entity):
self.notify_updated(entity)
--- a/web/views/staticcontrollers.py Thu May 24 14:01:05 2012 +0200
+++ b/web/views/staticcontrollers.py Fri May 25 16:19:21 2012 +0200
@@ -81,6 +81,8 @@
self._cw.validate_cache()
# XXX elif uri.startswith('/https/'): uri = uri[6:]
mimetype, encoding = mimetypes.guess_type(path)
+ if mimetype is None:
+ mimetype = 'application/octet-stream'
self._cw.set_content_type(mimetype, osp.basename(path), encoding)
with open(path, 'rb') as resource:
return resource.read()