def catch_all(path):
if not path.startswith('/'):
path = '/' + path
resp = Response('You want path: %s' % path)
if path.startswith('/ambassador/'):
resp.status_code = 200
elif path.endswith("/good/") or path.endswith("/demo/"):
resp.status_code = 200
resp.headers['X-Hurkle'] = 'Oh baby, oh baby.'
elif path.endswith("/nohdr/"):
resp.status_code = 200
# Don't add the header.
else:
resp.status_code = 403
resp.headers['X-Test'] = 'Should not be seen.'
return resp
评论列表
文章目录