otm.py 文件源码

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

项目:one-time-mail 作者: dividuum 项目源码 文件源码
def index():
    nonce = ''.join(random.sample(
        string.lowercase+string.digits, 16
    ))
    r = Response(render_template("otm.jinja",
        nonce=nonce
    ))
    r.headers['Content-Security-Policy'] = ';'.join((
        "default-src 'none'",
        "style-src 'nonce-%s'" % nonce,
        "script-src 'nonce-%s'" % nonce,
        "connect-src %s://%s/ws" % (
            "wss" if request.is_secure else "ws",
            request.host,
        ),
    ))
    r.headers['X-Frame-Options'] = 'DENY'
    return r
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号