views.py 文件源码

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

项目:oadoi 作者: Impactstory 项目源码 文件源码
def bookmarklet_js():
    base_url = request.url.replace(
        "browser-tools/bookmarklet.js",
        "static/browser-tools/"
    )

    if "localhost:" not in base_url:
        # seems like this shouldn't be necessary. but i think
        # flask's request.url is coming in with http even when
        # we asked for https on the server. weird.
        base_url = base_url.replace("http://", "https://")

    rendered = render_template(
        "browser-tools/bookmarklet.js",
        base_url=base_url
    )
    resp = make_response(rendered, 200)
    resp.mimetype = "application/javascript"
    return resp
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号