def process_request(self, req, resp):
# req.host has the port stripped from what the browser
# sent us, even when it isn't 80, which is probably a bug
# in Falcon. We deal with that in __init__ by removing
# ports from self.hosts.
if req.host not in self.hosts:
print("Attempted request with Host header '%s' denied" % req.host)
raise falcon.HTTPForbidden("Bad Host header", "Cannot connect via the provided hostname")
# the gunicorn application
评论列表
文章目录