This commit is contained in:
@@ -64,6 +64,24 @@ def setup_static_files(app: FastAPI) -> None:
|
||||
return FileResponse(index_file)
|
||||
else:
|
||||
return {"message": "NFOGuard Web Interface", "status": "running"}
|
||||
|
||||
# Serve favicon
|
||||
@app.get("/favicon.ico")
|
||||
async def serve_favicon():
|
||||
# Try to serve favicon from logo directory or static files
|
||||
favicon_paths = [
|
||||
os.path.join(logo_path, "favicon.ico"),
|
||||
os.path.join(static_path, "favicon.ico"),
|
||||
os.path.join(logo_path, "NFOguardLogoPlain.png") # Fallback to logo
|
||||
]
|
||||
|
||||
for favicon_path in favicon_paths:
|
||||
if os.path.exists(favicon_path):
|
||||
return FileResponse(favicon_path)
|
||||
|
||||
# Return 204 No Content if no favicon found
|
||||
from fastapi import Response
|
||||
return Response(status_code=204)
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user