def get_api_key():
"""Return the api key or None."""
header = request.headers.get('Authorization')
if not header: return
try:
method, data = header.split(None, 1)
if method.lower() != 'api-key': return
return touni(base64.b64decode(tob(data[4:])))
except (ValueError, TypeError):
abort(401, HEADER_ERROR)
app.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录