Files
TK-Wiki-Newsletter/app/core/cookies.py
smueller e5e4d812c7 Update configuration and enhance newsletter generation features
- Change WIKI_API_URL in .env.example and config to point to the new API endpoint.
- Set COOKIE_SECURE to false for local development in .env.example and config.
- Improve the newsletter generation logic to handle new and edited articles separately.
- Add display options for showing date, user, and category in the newsletter output.
- Enhance error handling for Wiki API requests and update templates for better user feedback.
- Update CSS for new UI elements and improve overall layout in dashboard and login pages.
2026-07-03 12:47:35 +02:00

14 lines
447 B
Python

from fastapi import Request
from app.core.config import settings
def cookie_secure(request: Request) -> bool:
"""Secure-Flag nur setzen, wenn aktiviert und die Anfrage wirklich per HTTPS läuft."""
if not settings.cookie_secure:
return False
forwarded = request.headers.get("x-forwarded-proto", "")
if forwarded:
return forwarded.split(",")[0].strip().lower() == "https"
return request.url.scheme == "https"