api_server.py 文件源码

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

项目:kytos 作者: kytos 项目源码 文件源码
def shutdown_api(self):
        """Handle shutdown requests received by Api Server.

        This method must be called by kytos using the method
        stop_api_server, otherwise this request will be ignored.
        """
        allowed_host = ['127.0.0.1:'+str(self.port),
                        'localhost:'+str(self.port)]
        if request.host not in allowed_host:
            return "", 403

        self.server.stop()

        return 'Server shutting down...', 200
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号