Fix linting

This commit is contained in:
yangdx
2025-03-12 18:55:15 +08:00
parent 5c1cf6a8ff
commit 330f608fa9
7 changed files with 19 additions and 17 deletions

View File

@@ -427,10 +427,12 @@ def create_app(args):
class NoCacheStaticFiles(StaticFiles):
async def get_response(self, path: str, scope):
response = await super().get_response(path, scope)
if path.endswith('.html'):
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
response.headers['Pragma'] = 'no-cache'
response.headers['Expires'] = '0'
if path.endswith(".html"):
response.headers["Cache-Control"] = (
"no-cache, no-store, must-revalidate"
)
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "0"
return response
# Webui mount webui/index.html