Fix dispatcher when there is no content-type in response

This commit is contained in:
Jerome Schneider 2012-03-05 11:47:31 +01:00
parent 65fecdb4d4
commit 22c69221c1
1 changed files with 1 additions and 1 deletions

View File

@ -170,7 +170,7 @@ class Dispatcher(object):
# Calling hook function
for hook in self.req_mapping['on_response']:
content_type = response.headers.getheader('content-type')
if hook.has_key('content-types'):
if hook.has_key('content-types') and content_type:
if content_type.split(';')[0] not in hook['content-types']:
logger.debug("Don't load filter %s (content-type %s doesn't match)" % (hook['filter'], content_type))
continue