allowed_methods.py 文件源码

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

项目:auth-tool 作者: luciddg 项目源码 文件源码
def _check_method(cls, allowed_methods=VALID_METHODS):
        """
        Validate the request method is in the set of allowed methods.
        If not, set the Allow header to the list of allowed methods and
        return a 405 (Method Not Allowed).
        """
        if cherrypy.request.method.upper() not in allowed_methods:
            cherrypy.response.headers['Allow'] = (', ').join(allowed_methods)
            raise cherrypy.HTTPError(405)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号