mirror of
https://github.com/revanced/revanced-api.git
synced 2025-04-29 22:24:31 +02:00
fix: add required headers (#8)
* fix: add required headers * ci: remove compose linter
This commit is contained in:
parent
4fde994292
commit
f4c10dc064
@ -16,10 +16,6 @@ repos:
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3.11
|
||||
- repo: https://github.com/iamthefij/docker-pre-commit
|
||||
rev: v3.0.1
|
||||
hooks:
|
||||
- id: docker-compose-check
|
||||
- repo: https://github.com/pryorda/dockerfilelint-precommit-hooks
|
||||
rev: v0.1.0
|
||||
hooks:
|
||||
|
12
app.py
12
app.py
@ -37,3 +37,15 @@ def get_static_function(value):
|
||||
|
||||
for src, dest in REDIRECTS.items():
|
||||
app.route(src)(get_static_function(sanic.response.redirect(dest)))
|
||||
|
||||
|
||||
@app.middleware("response")
|
||||
async def add_cache_control(request, response):
|
||||
response.headers["Cache-Control"] = "public, max-age=300"
|
||||
|
||||
|
||||
@app.middleware("response")
|
||||
async def add_csp(request, response):
|
||||
response.headers[
|
||||
"Content-Security-Policy"
|
||||
] = "default-src * 'unsafe-inline' 'unsafe-eval'; img-src * data:;"
|
||||
|
Loading…
x
Reference in New Issue
Block a user