httpproxy.py 文件源码

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

项目:plugin.audio.spotify 作者: marcelveldt 项目源码 文件源码
def _check_request(self):
        method = cherrypy.request.method.upper()
        headers = cherrypy.request.headers
        # Fail for other methods than get or head
        if method not in ("GET", "HEAD"):
            raise cherrypy.HTTPError(405)
        # Error if the requester is not allowed
        # for now this is a simple check just checking if the useragent matches Kodi
        user_agent = headers['User-Agent'].lower()
        if not ("kodi" in user_agent or "osmc" in user_agent):
            raise cherrypy.HTTPError(403)
        return method
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号