# HG changeset patch # User Aurelien Campeas # Date 1337955561 -7200 # Node ID 63c4c65e4db1a00334e0489f97234fadfa4c2856 # Parent 1cb51cdb4ce7937c2952239f145e31e0ded94394 [web/views/staticcontroller] safety belt for unguessed mimetypes (closes #2380304) diff -r 1cb51cdb4ce7 -r 63c4c65e4db1 sobjects/ldapparser.py --- 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) diff -r 1cb51cdb4ce7 -r 63c4c65e4db1 web/views/staticcontrollers.py --- 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()