mirror of
https://github.com/revanced/revanced-api.git
synced 2025-04-29 22:24:31 +02:00
refact: middleware decorator change
This commit is contained in:
parent
99e645c5f5
commit
5bdf661555
4
app.py
4
app.py
@ -62,12 +62,12 @@ for src, dest in REDIRECTS.items():
|
||||
app.route(src)(get_static_function(sanic.response.redirect(dest)))
|
||||
|
||||
|
||||
@app.middleware("response")
|
||||
@app.on_response
|
||||
async def add_cache_control(request, response):
|
||||
response.headers["Cache-Control"] = "public, max-age=300"
|
||||
|
||||
|
||||
@app.middleware("response")
|
||||
@app.on_response
|
||||
async def add_csp(request, response):
|
||||
response.headers[
|
||||
"Content-Security-Policy"
|
||||
|
Loading…
x
Reference in New Issue
Block a user