wsgi.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:glare 作者: openstack 项目源码 文件源码
def _dispatch(req):
        """Called by self._router after matching the incoming request to a route
        and putting the information into req.environ.  Either returns 404,
        501, or the routed WSGI app's response.
        """
        match = req.environ['wsgiorg.routing_args'][1]
        if not match:
            implemented_http_methods = ['GET', 'HEAD', 'POST', 'PUT',
                                        'DELETE', 'PATCH']
            if req.environ['REQUEST_METHOD'] not in implemented_http_methods:
                return webob.exc.HTTPNotImplemented()
            else:
                return webob.exc.HTTPNotFound()
        app = match['controller']
        return app
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号