__init__.py 文件源码

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

项目:pillar 作者: armadillica 项目源码 文件源码
def handle_sdk_method_not_allowed(self, error):
        """Forwards 405 Method Not Allowed to the client.

        This is actually not fair, as a 405 between Pillar and Pillar-Web
        doesn't imply that the request the client did on Pillar-Web is not
        allowed. However, it does allow us to debug this if it happens, by
        watching for 405s in the browser.
        """
        from flask import request

        self.log.info('Forwarding MethodNotAllowed exception to client: %s', error, exc_info=True)
        self.log.info('HTTP Referer is %r', request.referrer)

        # Raising a Werkzeug 405 exception doens't work, as Flask turns it into a 500.
        return 'The requested HTTP method is not allowed on this URL.', 405
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号