add warning for when content_type mismatch
This commit is contained in:
@@ -387,6 +387,12 @@ class Pecan(object):
|
||||
request.pecan['content_type'] = cfg.get('content_type', 'text/html')
|
||||
elif cfg.get('content_type') is not None and \
|
||||
request.pecan['content_type'] not in cfg.get('content_types', {}):
|
||||
|
||||
print "Controller '%s' defined does not support content_type '%s'. Supported type(s): %s" % (
|
||||
controller.__name__,
|
||||
request.pecan['content_type'],
|
||||
cfg.get('content_types', {}).keys()
|
||||
)
|
||||
raise exc.HTTPNotFound
|
||||
|
||||
# get a sorted list of hooks, by priority
|
||||
|
||||
Reference in New Issue
Block a user