Fix profile CSS on localhost (#260)

master
float-trip 2022-05-12 10:21:55 -04:00 committed by GitHub
parent a829b156d7
commit 9be2264a65
1 changed files with 9 additions and 6 deletions

View File

@ -542,7 +542,8 @@ def leaderboard(v):
def get_css(username): def get_css(username):
user = get_user(username) user = get_user(username)
resp = make_response(user.css or "") resp = make_response(user.css or "")
resp.headers.add("Content-Type", "text/css") resp.headers["Content-Type"] = "text/css"
resp.headers["Referrer-Policy"] = "no-referrer"
return resp return resp
@app.get("/@<username>/profilecss") @app.get("/@<username>/profilecss")
@ -551,7 +552,8 @@ def get_profilecss(username):
if user.profilecss: profilecss = user.profilecss if user.profilecss: profilecss = user.profilecss
else: profilecss = "" else: profilecss = ""
resp = make_response(profilecss) resp = make_response(profilecss)
resp.headers.add("Content-Type", "text/css") resp.headers["Content-Type"] = "text/css"
resp.headers["Referrer-Policy"] = "no-referrer"
return resp return resp
@app.get("/id/<id>/profilecss") @app.get("/id/<id>/profilecss")
@ -560,7 +562,8 @@ def get_profilecss_id(id):
if user.profilecss: profilecss = user.profilecss if user.profilecss: profilecss = user.profilecss
else: profilecss = "" else: profilecss = ""
resp = make_response(profilecss) resp = make_response(profilecss)
resp.headers.add("Content-Type", "text/css") resp.headers["Content-Type"] = "text/css"
resp.headers["Referrer-Policy"] = "no-referrer"
return resp return resp
@app.get("/@<username>/song") @app.get("/@<username>/song")